Error using *: Inner matrix dimensions must agree.

1 visualización (últimos 30 días)
Yasmine Sellwood
Yasmine Sellwood el 27 de Ag. de 2020
Comentada: madhan ravi el 27 de Ag. de 2020
Can someone please tell me why I am getting an error on the below code?
samplelength = length(s1);
n_harm = (0:5);
TimePeriod = SinglePeriod;
T_samples = SinglePeriod(2) - SinglePeriod(1);
fT = samplelength * T_samples;
f0 = 1/fT;
omega_t = 2*pi*n_harm*f0*TimePeriod;
omega_t2 = 2*pi*n_harm*f0*t;
The error I get is
Error using *
Inner matrix dimensions must agree.
Error in mission (line 109)
omega_t = 2*pi*n_harm*f0*TimePeriod;

Respuestas (1)

madhan ravi
madhan ravi el 27 de Ag. de 2020
Use .*
  2 comentarios
Yasmine Sellwood
Yasmine Sellwood el 27 de Ag. de 2020
Editada: Yasmine Sellwood el 27 de Ag. de 2020
where?
If I do omega_t = 2.*pi.*n_harm.*f0.*TimePeriod; I'm then getting an error saying my matrix dimensions must agree?
madhan ravi
madhan ravi el 27 de Ag. de 2020
omega_t = 2*pi*n_harm*f0.*TimePeriod(:);

Iniciar sesión para comentar.

Categorías

Más información sobre Creating and Concatenating Matrices 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