Read Data From txt file using uigetfile...
7 ビュー (過去 30 日間)
古いコメントを表示
Hi
I Have to read a file using uigetfile by this code by i face the error...
[filename,pathname,d] = uigetfile('*.txt;');
filepath=fullfile('pathname','filename');
fid = fopen('filepath');
mline1 = textscan(fid, '%f%s%s%f%f%s%s%f%f ','HeaderLines',5);
fclose(fid);
Error:
Error using textscan
Invalid file identifier. Use fopen to generate a valid
file identifier.
By The Way I Already have done it without using uigetfile...
another point is data should be a number not a string cause they are going to plotted... What should i do to convert them???
1 件のコメント
Walter Roberson
2013 年 6 月 21 日
For the bit about it needing to be a number, we need a sample input line.
採用された回答
Walter Roberson
2013 年 6 月 21 日
do not put the aote matks around filepath.
fopen(filepath)
その他の回答 (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!