In MATLAB R2018a, I have tried running my code 2500 times and effectively beyond which I am not able to run completely. Even with very high laptop specs, it doesnt generate all 3000 or 5000 random values. How to generate them effectively?

3 vues (au cours des 30 derniers jours)
Is there any way I could run a .m file more than 10000 times?
  5 commentaires
Stephen23
Stephen23 le 5 Juin 2021
Modifié(e) : Stephen23 le 5 Juin 2021
Original question by Kasyap Suresh on 2nd October 2018:
In MATLAB R2018a, I have tried running my code 2500 times and effectively beyond which I am not able to run completely. Even with very high laptop specs, it doesnt generate all 3000 or 5000 random values. How to generate them effectively?
So, I have actually passed my signal over an AWGN channel and I want to record the power of the signal upon every iteration. When I do that for 100 or 2000, it works fine. But beyond 2000, it doesn't generate the number I desire. Here is the matab code.
%%%AWGNSIMULATION.m%%
close all;
clear;
c1 = [1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0];
c2 = [1 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0];
c3 = [1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0];
c4 = [1 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0];
c5 = [1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0];
%Linear Convolution algorithm%
c=(c1+c2+c3+c4+c5);
disp(c);
%Measured from awgn block%
noisedSignal = comm.AWGNChannel('EbNo',5,'BitsPerSymbol',1);
NN = noisedSignal(c);
SN = norm(c.^2)/length(c); %// power of noised signal
disp(SN);
And for running it multiple times. This is my code.
for ii=1:1:10000
AWGNSIMULATION();
end
I ran this code in a different .m script.
I don't know why it couldn't run more than 2000 times if it can run a 100 or a 1000 or 2000.

Connectez-vous pour commenter.

Réponses (1)

Walter Roberson
Walter Roberson le 5 Oct 2018
Your "clear" is probably interfering.
You should restructure and correct your code. Perhaps the two attached files.

Catégories

En savoir plus sur Test and Measurement dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by