Filter löschen
Filter löschen

How to assign desired names for created files by Matlab?

1 Ansicht (letzte 30 Tage)
Masoud Taleb
Masoud Taleb am 28 Apr. 2020
Kommentiert: darova am 28 Apr. 2020
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.

Akzeptierte Antwort

darova
darova am 28 Apr. 2020
Simple example
for i = 1:5
s = sprintf('data%d',i);
A = rand(3);
writematrix(A,s)
end
  4 Kommentare
Masoud Taleb
Masoud Taleb am 28 Apr. 2020
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 am 28 Apr. 2020
I will be here waiting

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Environment and Settings finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by