Filter löschen
Filter löschen

How to make several run of m.file and report outputs in the figure?

1 Ansicht (letzte 30 Tage)
Beibit Sautbek
Beibit Sautbek am 21 Jul. 2016
Kommentiert: Geoff Hayes am 21 Jul. 2016
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 Kommentar
Geoff Hayes
Geoff Hayes am 21 Jul. 2016
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.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by