필터 지우기
필터 지우기

Error using *: Inner matrix dimensions must agree.

조회 수: 1 (최근 30일)
Yasmine Sellwood
Yasmine Sellwood 2020년 8월 27일
댓글: madhan ravi 2020년 8월 27일
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?
madhan ravi
madhan ravi 2020년 8월 27일
omega_t = 2*pi*n_harm*f0.*TimePeriod(:);

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by