Borrar filtros
Borrar filtros

plotting 100 times in same plot

2 visualizaciones (últimos 30 días)
Mayank Lakhani
Mayank Lakhani el 14 de Jul. de 2015
Editada: bio lim el 15 de Jul. de 2015
I want to plot the output x1, for 100 times on same graph. Since i am introducing randn noise in signal, output must be changing little bit everytime. Therefore, i can figure out, effect of noise on the signal. Thanks in advance.
t = [ 0 : 1 : 40 ]; % time samples
f = 500; % input frequency
fs = 8000; % sampling frequency
x = sin(2*pi*f/fs*t);
init_phase = randn(1,length(t));
x1 = x + init_phase;
plot(x1);

Respuesta aceptada

bio lim
bio lim el 14 de Jul. de 2015
Editada: bio lim el 15 de Jul. de 2015
t = [0 : 40]; % time samples
f = 500; % input frequency
fs = 8000; % sampling frequency
x = sin(2*pi*f/fs*t);
for k = 1 : 100
init_phase(k, :) = randn(1,length(t));
x1(k,:) = x + init_phase(k,:)
end
plot(x1);

Más respuestas (1)

Mayank Lakhani
Mayank Lakhani el 14 de Jul. de 2015
Thanks coffee :). This will help me.

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by