Error using *: Inner matrix dimensions must agree.

1 次查看(过去 30 天)
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;

回答(1 个)

madhan ravi
madhan ravi 2020-8-27
Use .*
  2 个评论
Yasmine Sellwood
Yasmine Sellwood 2020-8-27
编辑:Yasmine Sellwood 2020-8-27
where?
If I do omega_t = 2.*pi.*n_harm.*f0.*TimePeriod; I'm then getting an error saying my matrix dimensions must agree?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by