How to fopen in this case?
1 回表示 (過去 30 日間)
古いコメントを表示
Hi Everybody
Case1
fid = fopen('TTL_1.txt', 'w');
fprintf(fid3,'%s \n','ABCD;');
fclose(fid3);
Case2
file_name='TTL_1';
fid = fopen('file_name.txt', 'w');
fprintf(fid3,'%s \n','ABCD;');
fclose(fid3);
Case1 is OK!
However, Case 2 does not create a file.
How to fopen in this case?
Thanks!
0 件のコメント
採用された回答
the cyclist
2023 年 2 月 21 日
You need to concatenate two character arrays, one of which you defined ahead ...
file_name='TTL_1';
fid = fopen([file_name,'.txt'], 'w');
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Data Distribution Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!