Run a script multiple times and save outputs

조회 수: 3 (최근 30일)
Tomás
Tomás 2019년 10월 19일
댓글: Gustavo Rojas-Matute 2020년 8월 6일
I have a script that at the end outputs a 1x5 array named 'g' with 5 values. each time i run the script, the values of 'g' will change. what can i use to run my script say, 50 times, and obtain a 50x5 array of all my different runs of 'g'?

채택된 답변

Stephan
Stephan 2019년 10월 19일
편집: Stephan 2019년 10월 19일
Write a function or a second script which calls your script in a for loop and save the results in a new line of a result matrix for every run of your loop.
  댓글 수: 3
Tomás
Tomás 2019년 10월 19일
편집: Tomás 2019년 10월 19일
My script (problem3.m) had
clc; clear;
at the beginning so removing that solved the issue.
Gustavo Rojas-Matute
Gustavo Rojas-Matute 2020년 8월 6일
Hi Tomas, I am trying to do the same you did but when I try to fill the matrix: (c:,) it says:
Unrecognized function or variable 'c'.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by