clc;
clear;
fin=fopen('222.txt','r');
result={};
while feof(fin)==0
str=fgetl(fin);
str=strread(str,'%s','delimiter',' \n');
result=[result;str];
end
disp(result);
fclose(fin);
for ii=1:length(result)
[a,b]=strread(result{ii},'%d+j%d');
c(ii)=complex(a,b);
end
怎样在matlab工作空间中导入txt文件里的复数矩阵?
最新推荐文章于 2024-07-10 16:43:12 发布