![]() |
[求助]不知是什么问题,请高手看看
这是函数中的命令:
function PlotStress(iStress) %显示应力云图 %iStress----应力分量指示,可以为: %1----x方向正应力 %2----y方向正应力 %3----剪应力 %4----第一主应力 %5----第二主应力 %6----最大剪应力 global gNode gElement gNodeStress switch iStress case 1 title='x方向正应力'; case 2 title='y方向正应力'; case 3 title='剪应力'; case 4 title='最大主应力'; case 5 title='最小主应力'; case 6 title='最大剪应力'; end figure; axis equal; axis off; set(gcf,'NumberTitle','off'); set(gcf,'Name',title); Minstress=gNodeStress(:,iStress) Maxstress=max( gNodeStress(:,iStress)); caxis([Minstress,Maxstress]); colormap('gray'); 当运行PlotStress(4) 则出现下列错误提示: ??? Attempted to access gNodeStress(:,4); index out of bounds because size(gNodeStress)=[0,0]. Error in ==> PlotStress at 32 Minstress=gNodeStress(:,iStress) 不明白哪儿出问题了,请高手帮忙看看,谢谢啊!! |
[color=red]Attempted to access gNodeStress(:,4); index out of bounds because size(gNodeStress)=[0,0][/color]
变量gNodeStress是空的,你仔细检查你的程序,编的时候有地方出错了。 |
[QUOTE=dnping;5247][color=red]Attempted to access gNodeStress(:,4); index out of bounds because size(gNodeStress)=[0,0][/color]
变量gNodeStress是空的,你仔细检查你的程序,编的时候有地方出错了。[/QUOTE] 犯了一个低级的错误,未在引用函数前加global命令!!真是 不好意思的很~~~ |
所有时间均为北京时间。现在的时间是 11:28。 |
Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.