1
複數我有一個包含512個複數列的文本文件:Matlab的:讀取文本文件
1.065628906250000000e+05+2.257825312500000000e+05j
-1.760229375000000000e+05+1.983590781250000000e+05j
-2.912515312500000000e+05+-3.984878515625000000e+04j
-1.352125156250000000e+05+-2.334627812500000000e+05j
1.342380781250000000e+05+-1.729340312500000000e+05j
2.412725312500000000e+05+6.533162500000000000e+04j
9.673526562500000000e+04+2.301303906250000000e+05j
-1.395607343750000000e+05+1.602902187500000000e+05j
-2.091153281250000000e+05+-7.081546093750000000e+04j
-5.124144921875000000e+04+-2.195292500000000000e+05j
1.513754218750000000e+05+-1.365697968750000000e+05j
2.135251718750000000e+05+8.967863281250000000e+04j
6.891373437500000000e+04+2.228926250000000000e+05j
-1.180648906250000000e+05+1.324545156250000000e+05j
-1.687760468750000000e+05+-7.878281250000000000e+04j
-2.107323242187500000e+04+-2.112779843750000000e+05j
1.451967500000000000e+05+-1.367522812500000000e+05j
1.819310781250000000e+05+7.434533593750000000e+04j
4.500193750000000000e+04+1.951718906250000000e+05j
-1.208624140625000000e+05+1.250783046875000000e+05j
-1.320503906250000000e+05+-8.381024218750000000e+04j
4.598049316406250000e+03+-2.092511093750000000e+05j
1.398188750000000000e+05+-1.318195156250000000e+05j
1.370294375000000000e+05+6.731912500000000000e+04j
-2.108746093750000000e+04+1.740979375000000000e+05j
-1.650594218750000000e+05+8.201840625000000000e+04j
-1.426277187500000000e+05+-1.057813437500000000e+05j
我怎麼能看這種到Matlab?使用代碼:
fileID = fopen('y.txt','r');
A = textscan(fileID,'%f');
fclose(fileID);
A{1}
我得到的輸出:
>> A{1}
ans =
1.0e+05 *
1.0656 + 2.2578i
-1.7602 + 1.9836i
-2.9125 + 0.0000i
爲什麼Matlab的只有前3行讀取和爲什麼它獲得第3行不正確(0.000i複雜的價值,而不是-3.98e04i)?