24小时热门版块排行榜    

查看: 958  |  回复: 0

beckzx

新虫 (初入文坛)

[求助] matlab 提示Index exceeds matrix dimensions问题,求高手解决

求告诉解决。显示错误发生在该代码片段最后一行。Index exceeds matrix dimensions.
Error in MLMS7_tang (line 27)
        shear_x{level}(poff+m,poff+n) = ...
部分代码:
shear_x=cell(N,1);

[Mx, My]=size(qx);
poff = 4*t; % offset used for storing pressure, to allow i,j=0
shear_x{1}=zeros(Mx+2*poff,My+2*poff);
shear_x{1}(poff+(1:Mx),poff+(1:My))=qx;

for level=2:N,
       
        disp(['Calculating shear_x for level ' num2str(level)]);
       
        Mx = grid(level,1);
        My = grid(level,2);
        m=1:Mx;
        n=1:My;
        i=1+2*(m-t);
        j=1+2*(n-t);
       
        shear_x{level}=zeros(Mx+2*poff,My+2*poff);
       
        shear_x{level}(poff+m,poff+n) = ...
                0.25*shear_x{level-1}(poff+i,poff+j);
回复此楼

» 猜你喜欢

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

智能机器人

Robot (super robot)

我们都爱小木虫

相关版块跳转 我要订阅楼主 beckzx 的主题更新
信息提示
请填处理意见