我想将fortran转换为matlab。
-fortran 代码
DO 20 I=1,3
DO 20 J=1,4
20 WORMX(I,J)=0.0
DO 24 INODE=1,8
IPOIN=IABS(LNODS(IELEM,INODE0)
DO 24 K=1,3
GTOP=COORD(IPOIN,K)
GBOT=COORD(IPOIN,K+4)
GOSH=((1.0+ZETA)*GTOP+(1.0-ZETA)*GBOT)/2.0
DO 22 J=1:3
22 WORMX(K,J)=WORMX(K,J)+GOSH*SHAPE(J,INODE)
24 WORMX(K,4)=WORMX(K,4)=WORMX(K,4)+SHAPE(1,INODE)*GTOP-BBOT)/2.0
CALL MATM(2,5,0,1)
. . . -matlab代码
function FUNC
global LNODS COORDI SHAPE NELEM DZETTA
for I=1:3
for J=1:4
WORMX=zeros(I,J);
end
end
SHAPE=zeros(3,9);
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);
end
WORMX(K,4)=WORMX(K,4)+SHAPE(1,INODE)*(GTOP-GBOT)/2.0;
end
end
end
MATM(2, 5, 0, 1)
. .
我在 matlab 代码中收到一条错误消息,
"Undefined function or method 'MATM' for input arguments of type 'double'."
这段代码有什么问题?