Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Variables within a for loop

1 Ansicht (letzte 30 Tage)
Dominika
Dominika am 5 Mär. 2014
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
Hi I'm a beginner with Matlab. I want to create variables using a for loop:
Acc1=File_velocity_level_var1
Acc2=File_velocity_level_var2
.
.
Acc7=File_velocity_level_var7
I'm trying with this:
for n=1:7
Acc=strcat('File_velocity_level_var',n);
end
it just creates Acc=File_velocity_level_var
Please, help :)
  2 Kommentare
David Young
David Young am 5 Mär. 2014
If you made that comment an answer, I could (and would) vote for it!

Antworten (2)

Matt J
Matt J am 5 Mär. 2014
Bearbeitet: Matt J am 5 Mär. 2014
You should be doing something like this,
for n=1:7
Acc{n}=['File_velocity_level_var',num2str(n)];
end
Now you have all the file names contained in the entries Acc{i} of a single variable Acc.

Dominika
Dominika am 8 Mär. 2014
Thanks for all the answers

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by