matlab数组索引必须为正整数或逻辑值是什么意思?

如图,不知道怎么改,麻烦各位大佬啦 [图片]
关注者
8
被浏览
74,986

3 个回答

亲测,没错。下次把代码发上来,省的我敲

x = -10:0.4:10;
y = -10:0.4:10;
[X,Y] = meshgrid(x,y);
Z = sin(X) + cos(Y);
h = surf(X,Y,Z);
axis([-10,10,-10,10,-5,5])
while true
    for ii = 1:100
        Z = 0.97*Z;
        set(h,'XData',X,'YData',Y,'ZData',Z);
        drawnow;
    for ii = 1:100