Borrar filtros
Borrar filtros

Error when plot3 is used: vectors must be of same length

2 visualizaciones (últimos 30 días)
Athira Surendran
Athira Surendran el 29 de Mzo. de 2017
Editada: Athira Surendran el 29 de Mzo. de 2017
Hi,
I want to plot all the fft plots in a single figure. something like the attached image
Here's my code
for i=1:m
[f(i,:) mag(i,:)]=fftplot(2000000,corr_amp(i,:));
end;
plot3(f,load,mag);
when i used plot3 it is not coming as in the image
Can someone help me to figure it out?
Athira

Respuestas (1)

Jan
Jan el 29 de Mzo. de 2017
The error message is clear: f, load and mag do not have the same size. Because f and mag should have the same size, I guess that load is the problem.
Please check its size. Perhaps a simple transpose() is enough. But if other operations are required, you have to explain at first, what you want to happen with the values of load.
  1 comentario
Athira Surendran
Athira Surendran el 29 de Mzo. de 2017
Editada: Athira Surendran el 29 de Mzo. de 2017
Hi, What i need is to stack the fft plots corresponding to each load values. So basically each rows of 'f' corresponds to fft plot at each values of load. The 'load' is row vector. Number of columns in 'load' is same as number of rows in 'f' and 'mag'( where mag is nothing but the magnitude of fft).
and yes i tried with transpose(load) also, but still its not working.
As you said 'mag' and 'f' are having same size.

Iniciar sesión para comentar.

Categorías

Más información sobre Frequency Transformations en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by