a=[1,2,3;4,5,6;7,8,9];

  a=reshape(a,1,9);  a=[1,4,7,2,5,8,3,6,9];

  a=reshape(a,9,1);  a=[1;4;7;2;5;8;3;6;9];

a=[1,2,3,4,5,6,7,8,9];

  a=reshape(a,3,3);  a=[1,4,7;2,5,8;3,6,9];

也就是说,reshape以列为主体。

04-28 22:49