필터 지우기
필터 지우기

Looping to create multiple variables?

조회 수: 38 (최근 30일)
Amos Tan
Amos Tan 2017년 10월 13일
댓글: Amos Tan 2017년 10월 14일
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
Adam
Adam 2017년 10월 13일
You should never want 50 variables in your workspace when 1 would do!
Amos Tan
Amos Tan 2017년 10월 14일
thank you for the advice! (:

댓글을 달려면 로그인하십시오.

채택된 답변

KL
KL 2017년 10월 13일
편집: KL 2017년 10월 13일
  댓글 수: 1
Amos Tan
Amos Tan 2017년 10월 14일
thank you for the links and for the code (:

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2017년 10월 13일

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by