How to assign desired names for created files by Matlab?

1 回表示 (過去 30 日間)
Masoud Taleb
Masoud Taleb 2020 年 4 月 28 日
コメント済み: darova 2020 年 4 月 28 日
Hello
my Matlab code saves each matrix as a csv file at the end. The problem is the file names. I want names to be taken from a calumn of names such as [b12;b20;b75;b151], one after each other. How should I assign each element of this vector as a file name? I appreciate if someone can help in this.

採用された回答

darova
darova 2020 年 4 月 28 日
Simple example
for i = 1:5
s = sprintf('data%d',i);
A = rand(3);
writematrix(A,s)
end
  4 件のコメント
Masoud Taleb
Masoud Taleb 2020 年 4 月 28 日
Thanks Tara
This works. I just need to adjust it in my code. I will ask if there was an issue doing it :)
darova
darova 2020 年 4 月 28 日
I will be here waiting

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by