<>你在运行这个之前已经给A,x赋值过了的吧?</P><>你要单独运行这两段程序能够象你说的一样的话,可以向mathworks要$</P><>附我运行的结果:</P><P>>> for n=1:10
x(n)=sin(n*pi/10);
end</P><P>>> whos
Name Size Bytes Class</P><P> n 1x1 8 double array
x 1x10 80 double array</P><P>Grand total is 11 elements using 88 bytes</P><P>>> for n=1:5</P><P> for m=5:-1:1</P><P> A(n,m)=n^2+m^2;</P><P> end </P><P> disp(n)</P><P>end</P><P> 1</P><P> 2</P><P> 3</P><P> 4</P><P> 5</P><P>>> whos
Name Size Bytes Class</P><P> A 5x5 200 double array
m 1x1 8 double array
n 1x1 8 double array
x 1x10 80 double array</P><P>Grand total is 37 elements using 296 bytes</P><P>>> </P>