问一下在matlab中出现Subscript indices must either be real positive integers or logicals是啥意思[kx,ky]=meshgrid(0:pi/100:pi,0:pi/100:pi)u=0.5t1=-1,t2=1.3,t3=0.85,t4=0.85ax(kx,ky)=-2*t1.*cos(kx)-2*t2.*cos(ky)-4*t3.*cos(kx).*cos(ky) ay(kx,ky
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/17 02:45:14
问一下在matlab中出现Subscript indices must either be real positive integers or logicals是啥意思[kx,ky]=meshgrid(0:pi/100:pi,0:pi/100:pi)u=0.5t1=-1,t2=1.3,t3=0.85,t4=0.85ax(kx,ky)=-2*t1.*cos(kx)-2*t2.*cos(ky)-4*t3.*cos(kx).*cos(ky) ay(kx,ky
问一下在matlab中出现Subscript indices must either be real positive integers or logicals是啥意思
[kx,ky]=meshgrid(0:pi/100:pi,0:pi/100:pi)
u=0.5
t1=-1,t2=1.3,t3=0.85,t4=0.85
ax(kx,ky)=-2*t1.*cos(kx)-2*t2.*cos(ky)-4*t3.*cos(kx).*cos(ky)
ay(kx,ky)=-2*t2.*cos(kx)-2*t1.*cos(ky)-4*t3.*cos(kx).*cos(ky)
axy(kx,ky)=-4*t4.*sin(kx).*sin(ky)
au(kx,ky)=0.5*ax(kx,ky)+0.5*ay(kx,ky),a_(kkx,ky)=0.5*ax(kx,ky)-0.5*ay(kx,ky)
Eu(kx,ky)=au(kx,ky)+sqrt((a_(kx,ky)).^2+(axy(kx,ky)).^2)-u
E_(kx,ky)=au(kx,ky)-sqrt((a_(kx,ky)).^2+(axy(kx,ky)).^2)-u
plot(Eu(kx,ky),E_(kx,ky))
问一下在matlab中出现Subscript indices must either be real positive integers or logicals是啥意思[kx,ky]=meshgrid(0:pi/100:pi,0:pi/100:pi)u=0.5t1=-1,t2=1.3,t3=0.85,t4=0.85ax(kx,ky)=-2*t1.*cos(kx)-2*t2.*cos(ky)-4*t3.*cos(kx).*cos(ky) ay(kx,ky
在MATLAB,矩阵向量的下标只能从1开始,不能从0开始.提醒你错误的意思是“下标只能是正实数或逻辑值”.
你的ax矩阵是(0,0)开始的矩阵,所以出错.