Save array of names

2 Ansichten (letzte 30 Tage)
Nik Rocky
Nik Rocky am 22 Jun. 2020
Kommentiert: Nik Rocky am 22 Jun. 2020
Hello, I need to print a names of mesures in plot and i need an array than have a names of all measures:
name_save =
name1
name2
name3
.....
nameN
I get a new names everry loop:
for k = 1:length(l)
.....
[filepath,name,ext] = fileparts(l(k).name);
........
end
How can I save the names in a loop?
name_save(k) = name; %not working
Thank you!

Akzeptierte Antwort

madhan ravi
madhan ravi am 22 Jun. 2020
name_save = compose('name%d', 1:numel(l)) ; % before loop
name_save{k} ... inside loop
  4 Kommentare
madhan ravi
madhan ravi am 22 Jun. 2020
part_name = regexp(name_save{k},'\d*(?=\_)','match','once')
Nik Rocky
Nik Rocky am 22 Jun. 2020
Thank you friend!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Graph and Network Algorithms finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by