Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Eror Using * Inner matrix dimensions must agreee HELP
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello, here is my inputs
>> t=(0:t:2*pi);
>> y=exp(-0.3*t)*(2*cos(2*t)+4*sin(2*t))
Error using *
Inner matrix dimensions must agree.
the two trig values must be in a parenthesis, i do not understand the error any help would be greatly appreciated.
댓글 수: 0
답변 (1개)
Star Strider
2015년 2월 28일
Don’t you just hate it when your inner matrix dimensions argue? And over such trivial issues! I remember one time when ... But we can save that for a later time.
You need to vectorise your ‘y’ assignment:
t = pi/10;
t=(0:t:2*pi);
y=exp(-0.3*t).*(2*cos(2*t)+4*sin(2*t))
It produces:
y =
Columns 1 through 6
2.0000e+000 3.6122e+000 3.6625e+000 2.4015e+000 502.8544e-003 -1.2485e+000
Columns 7 through 12
-2.2548e+000 -2.2863e+000 -1.4991e+000 -313.8960e-003 779.3223e-003 1.4075e+000
Columns 13 through 18
1.4271e+000 935.7615e-003 195.9428e-003 -486.4751e-003 -878.6170e-003 -890.8659e-003
Columns 19 through 21
-584.1289e-003 -122.3131e-003 303.6716e-003
I created an initial value for ‘t’ that was necessary for the vector ‘t’. Choose the value you want.
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!