Error using *: Inner matrix dimensions must agree.
Show older comments
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;
Answers (1)
madhan ravi
on 27 Aug 2020
0 votes
Use .*
2 Comments
Yasmine Sellwood
on 27 Aug 2020
Edited: Yasmine Sellwood
on 27 Aug 2020
madhan ravi
on 27 Aug 2020
omega_t = 2*pi*n_harm*f0.*TimePeriod(:);
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!