How to load txt to matlab which is got by the fortran.
3 ビュー (過去 30 日間)
古いコメントを表示
my txt format is:
0.987548828125000 (15.0987939173195,0.000000000000000E+000)
1.97509765625000 (5.36979083395557,0.000000000000000E+000)
2.96264648437500 (2.49964765804540,0.000000000000000E+000)
3.95019531250000 (1.43875757499693,0.000000000000000E+000)
The first column is float and second is the complex.
How to load this txt to matlab
Thanks
0 件のコメント
回答 (1 件)
Walter Roberson
2013 年 6 月 22 日
fid = fopen('YourFile.txt', 'r');
datacell = textscan(fid, '%f(%f,%f)');
fclose(fid);
data = [datacell{1}, complex(datacell{2},datacell{3})];
参考
カテゴリ
Help Center および File Exchange で Fortran with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!