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!