How to make several run of m.file and report outputs in the figure?
조회 수: 1 (최근 30일)
이전 댓글 표시
I have m.file as below. I have a matrix d, where values are randomly changed during the running of m.file.
I need to make 10 runs of m.file and to take 10 different results(Floss). Then taken different results should be represented in the Figure.
Figure should contain:: 10 results of Floss VS number of runs (which is 10).
Floss VS number of runs
I don't need loop function, because my real m.file is huge, and I have a lot of outputs which is connected between each other.
So I need to run my m.file several times, and record just certain output, and figure out my results in a graph
Could anyone help me?
My code in m.file:
d=rand(10,1);
fr=800; %(in Hz);
Floss=32.44+(20.*log10(d(:,1)))+(20*log10(fr));
댓글 수: 1
Geoff Hayes
2016년 7월 21일
Beibit - from the little code that you have shown, it appears that your m file is just a script. So I would change it to a function that returns the random numbers d and the Floss
function [d,Floss] = myFunction
so that you can call this function ten (or whatever) times and obtain the d and the Floss for each call.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Directed Graphs에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!