当前位置: > MAtlab中To RESHAPE the number of elements must not change....
题目
MAtlab中To RESHAPE the number of elements must not change.
N1=14328;
N2=14328;
fid=fopen('ddfield.E15','r');
size=fscanf(fid,'%g');
fclose(fid);
aa1=reshape(size,9,N1*N2);
% X=reshape(aa1(1,:),N1,N2);
% Y=reshape(aa1(2,:),N1,N2);
% Z=reshape(aa1(3,:),N1,N2);
X=linspace(-15,15,N1);
Y=linspace(-15,15,N2);
Ex=reshape(aa1(4,:),N1,N2)+i*reshape(aa1(5,:),N1,N2);
Ey=reshape(aa1(6,:),N1,N2)+i*reshape(aa1(7,:),N1,N2);
Ez=reshape(aa1(8,:),N1,N2)+i*reshape(aa1(9,:),N1,N2);
E=(abs(Ex).^2+abs(Ey).^2+abs(Ez).^2).^(1/2);
figure,imagesc(X,Y,E)
colorbar

提问时间:2020-07-13

答案
你要reshape的话变之前和变了之后元素总数得相等, 你不可能把一个1000个元素的矩阵reshape成含有2000元素的矩阵
举一反三
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
1,人们染上烟瘾,最终因吸烟使自己丧命.
版权所有 CopyRight © 2012-2019 超级试练试题库 All Rights Reserved.