フィルターのクリア

create a new file

1 回表示 (過去 30 日間)
Tor Fredrik Hove
Tor Fredrik Hove 2011 年 10 月 24 日
回答済み: garima chandel 2014 年 8 月 6 日
>> fid=fopen('firstone.txt''w')
fid =
-1
>> fid=fopen('firstone.txt','w')
fid =
3
>> for i=1:3 fprintf(fid,'The loop variable is %d\n', i) end
ans =
23
ans =
23
ans =
23
>> fclose(fid)
ans =
0
>> while~feof(fid)
aline=fget1(fid)
end
??? Error using ==> feof Invalid file identifier. Use fopen to generate a valid file identifier.
>> fid=fopen('firstone.txt')
fid =
3
>> while~feof(fid)
aline=fget1(fid)
end
??? Undefined function or method 'fget1' for input arguments of type 'double'.
>>
What went wrong and I also wonder if the three answers equal 23 after creating the text means that anything is wrong?

採用された回答

Walter Roberson
Walter Roberson 2011 年 10 月 24 日
The routine name is fgetl ending with a lower-case L, not fget1 ending with the digit One.
The 23 just means that fprintf() wrote 23 characters to the file.

その他の回答 (1 件)

garima chandel
garima chandel 2014 年 8 月 6 日
??? Undefined function or method 'fgetline' for input arguments of type 'double'.
Error in ==> fgetl at 23 y = fgetline(fid);
Error in ==> eeg_getversion at 40 fgetl(fid);
Error in ==> eeglab>eeg_mainfig at 1202 W_MAIN = figure('Units','points', ...
Error in ==> eeglab at 449 javaobj = eeg_mainfig(onearg);
Getting error while loading eeglab command. Please help.

カテゴリ

Help Center および File ExchangeData Import and Export についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by