Filter löschen
Filter löschen

Looping to create multiple variables?

42 Ansichten (letzte 30 Tage)
Amos Tan
Amos Tan am 13 Okt. 2017
Kommentiert: Amos Tan am 14 Okt. 2017
I would like to run the following code 50 times, each time saving the output into a new variable (eg. s1, s2, s3,...,s50)
s = [reshape(randperm(32),[],1),randi(8,32,1)];
How would I do that?
Thank you! (sorry if this is a very trivial question, I'm new)
  2 Kommentare
Adam
Adam am 13 Okt. 2017
You should never want 50 variables in your workspace when 1 would do!
Amos Tan
Amos Tan am 14 Okt. 2017
thank you for the advice! (:

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

KL
KL am 13 Okt. 2017
Bearbeitet: KL am 13 Okt. 2017
  1 Kommentar
Amos Tan
Amos Tan am 14 Okt. 2017
thank you for the links and for the code (:

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Image Analyst
Image Analyst am 13 Okt. 2017

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by