指数超过矩阵维度

时间:2013-05-09 19:59:24

标签: matlab indexing

我写了这样的代码:

for INODE=1:8
   for IELEM=1:NELEM
      IPOIN=abs(LNODS(IELEM,INODE));
      for K=1:3
         GTOP=COORDI(IPOIN,K);
         GBOT=COORDI(IPOIN,K+4);
         GOSH=((1.0+0.91)*GTOP+(1.0-0.91)*GBOT)/2.0;
         for J=1:3
            WORMX(K,J)=WORMX(K,J)+GOSH*SHAPE(J,INODE);  <----error
         end
         WORMX(K,4)=WORMX(K,4)+SHAPE(1,INODE)*(GTOP-GBOT)/2.0;

      end
   end
end

我收到错误'索引超出矩阵维度' LNODS是9乘9矩阵,NELEM是9,INODE是1,COORDI是49乘8矩阵。

0 个答案:

没有答案