Borrar filtros
Borrar filtros

What should be the plot command?

1 visualización (últimos 30 días)
Priya
Priya el 30 de En. de 2014
Comentada: Priya el 30 de En. de 2014
deltaSignal = abs(testSignal - referenceSignal);
percentageDifference = deltaSignal ./ referenceSignal; % Percent by element.
meanPctDiff = mean(percentageDifference); % Average percentage over all elements
If you can please tell me how does the plot command looks like for the code above.
  1 comentario
Mischa Kim
Mischa Kim el 30 de En. de 2014
What exactly do you want to plot and how?

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 30 de En. de 2014
plot([deltaSignal(:), percentageDifference(:)])
However, it is likely that the two are on fairly different scales, so you probably want something more like
Fs = 44100; %sampling frequency. Example value.
t = (0 : length(deltaSignal) - 1) ./ Fs;
plotyy(t, deltaSignal, 'b', t, 100 * percentageDifference, 'gp');

Más respuestas (1)

Azzi Abdelmalek
Azzi Abdelmalek el 30 de En. de 2014
Read the documentation about plot
doc plot
Look at this example
t=0:0.01:10
y1=sin(t)
y2=cos(t)
plot(t,y1,t,y2)

Categorías

Más información sobre 2-D and 3-D Plots 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