How to store iterated loop sine function in matrix?
Mostra commenti meno recenti
I apologize because similar questions have been asked in the past, but I am very much a newbie to Matlab.
I am trying to store iterated results from an AM radio function in a for loop:
M=0.5;
A=0.5;
Fm=1;
Fc=100;
for x=0:0.0001:1
y=(1+M*sin(2*pi*Fm*x))*(A*sin(2*pi*Fc*x));
disp(y)
end
These results will need to be stored in a matrix format so that I can then plot the data as a histogram. Unfortunately, I am struggling to find a way to keep all values for y except the last result. Other suggestions for related topics (such as m(x:)=[x,y]) do not seem to work for me.
Thanks in advance for your help,
Sarah
1 Commento
madhan ravi
il 27 Gen 2019
what should be the final size of y?
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Loops and Conditional Statements in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!