哪位大神能帮忙看下这个MATLAB程序的错误在哪里
源程序如下:clearall,closeallM=4;KK=linspace(0,1,25);[X,Y]=meshgrid(KK,KK);form=1:MB_ss(:,m...
源程序如下:
clear all, close all
M=4; KK=linspace(0,1,25);
[X,Y]=meshgrid(KK,KK);
for m=1:M
B_ss(:,m)=sin(m*pi*KK);
end
fig=figure(1);
set(fig,'color',[1 1 1]);
set(fig,'unit','normalized');
set(fig,'position',[0.1 0.1 0.7 0.6]);
kk=0;
for m=1:2
for n=1:3
kk=kk+1;
Wx=B_ss(:,m); Wy=B_ss(:,n);
Wxy=Wx*Wy;
subplot(2,3,kk),mesh(X,Y,Wxy),
xlabel('\itx/L_x'), ylabel('\ity/L_x'),zlabel('mode shape')
colormap([0 0 0])
if m==1&n==1
text(0.5,1,1.3,'(1,1)mode','fontsize',12)
else
text(0.5,1,1.6,['('num2str(m)','num2str(n)')mode'],'fontsize',12)
end
end
end
错误提示为:Error: Unexpected MATLAB expression.
text(0.5,1,1.6,['('num2str(m)','num2str(n)')mode'],'fontsize',12)
↑ 展开
clear all, close all
M=4; KK=linspace(0,1,25);
[X,Y]=meshgrid(KK,KK);
for m=1:M
B_ss(:,m)=sin(m*pi*KK);
end
fig=figure(1);
set(fig,'color',[1 1 1]);
set(fig,'unit','normalized');
set(fig,'position',[0.1 0.1 0.7 0.6]);
kk=0;
for m=1:2
for n=1:3
kk=kk+1;
Wx=B_ss(:,m); Wy=B_ss(:,n);
Wxy=Wx*Wy;
subplot(2,3,kk),mesh(X,Y,Wxy),
xlabel('\itx/L_x'), ylabel('\ity/L_x'),zlabel('mode shape')
colormap([0 0 0])
if m==1&n==1
text(0.5,1,1.3,'(1,1)mode','fontsize',12)
else
text(0.5,1,1.6,['('num2str(m)','num2str(n)')mode'],'fontsize',12)
end
end
end
错误提示为:Error: Unexpected MATLAB expression.
text(0.5,1,1.6,['('num2str(m)','num2str(n)')mode'],'fontsize',12)
↑ 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询