フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Write an array of data to multiple text file but it shows error

1 回表示 (過去 30 日間)
AKHILA GOUDA
AKHILA GOUDA 2018 年 2 月 10 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
x =rand(10,1);
for i=1:10
A = x*i;
textFilename = ['akg_' num2str(i) '.txt'];
fid=fopen(textFilename,'w');
fprintf(fid,'%f\n',A(i));
fclose(fid);
end
I get the error
Error using fprintf
Invalid file identifier. Use fopen to generate a valid file identifier.
error in xyz (line 6)
fprintf(fid,'%f\n',A(i));
  4 件のコメント
per isakson
per isakson 2018 年 2 月 10 日
I guess you don't have write permission in the current directory
Write to a different directory
AKHILA GOUDA
AKHILA GOUDA 2018 年 2 月 10 日
yes sir exactly this is my mistake .. now it run there is no issue thanks a lot

回答 (0 件)

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by