how to save results in each loop by using for

1 visualización (últimos 30 días)
Mahdi Torabi
Mahdi Torabi el 8 de Mayo de 2017
Comentada: Adam el 8 de Mayo de 2017
I am running a program which I need to add white Gaussian noise on signal and filter it. I need to repeat the process for 100 times as I am applying random white Gaussian noise and take median for results, I am using 'for loop' from 1:100 and then need to save results individually for all loops. Could you please let me know that how results could be saved in output? for i = 1:100 - Adding noise - filtering part -Save results (?)
Thanks
  1 comentario
Adam
Adam el 8 de Mayo de 2017
results = zeros( 100, signalLen ); % Or the reverse, depending what works best for you)
for n = 1:100
results(n,:) = addNoiseAndFilter( mySignal );
end
Storing all results in a 2d matrix is the best approach. It makes the subsequent median trivial. If you want to save the end result to file you can, but it doesn't seem necessary.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Signal Generation and Preprocessing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by