using textscan to load numbers from txt file
1 回表示 (過去 30 日間)
古いコメントを表示
I am using textscan
tmp = textscan(fid,'%4f %q %f %f %f %f %f %f %f %f','treatAsEmpty', 'n/a');
to load data which looks like (skipping few columns)
1950 "Afghanistan" 8150.368
I get the year and the country without problems, but the third number is instead loaded as 0.8150...
I tried using something like %6.3f for the format input, but that just returns some dimension mismatch.
What am i doing wrong ?
2 件のコメント
採用された回答
Azzi Abdelmalek
2013 年 1 月 1 日
Your answer is correct. Maybe its displaying something like
ans =
1.0e+03 *
8.1504
8.2845
8.4253
Check this
a=tmp{3};
a(1)
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Data Import and Export についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!