My program doesn't write data to file

5 ビュー (過去 30 日間)
Milosz Wisniewski
Milosz Wisniewski 2021 年 3 月 29 日
回答済み: Cris LaPierre 2021 年 3 月 29 日
I don't know why this program doesn't work. I think is good, but I don't know.
clc, clear;
plik = fopen('dane.txt','w');
x = -5:1:5;
y = -5:1:5;
z = sin(x).*exp(y.*y);
fprintf(plik,'\tx\ty\tz\n%6.3f\t%6.3f\t%6.3f\n', [x;y;z]);
fclose(plik);

回答 (1 件)

Cris LaPierre
Cris LaPierre 2021 年 3 月 29 日
Works for me. What do you mean by "this program doesn't work"? Do you mean it's not creating the file, or the file contents are not what you wanted?

カテゴリ

Help Center および File ExchangeLow-Level File I/O についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by