Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Eror Using * Inner matrix dimensions must agreee HELP

1 visualización (últimos 30 días)
Isaac Al-rai
Isaac Al-rai el 28 de Feb. de 2015
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
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.

Respuestas (1)

Star Strider
Star Strider el 28 de Feb. de 2015
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.

La pregunta está cerrada.

Community Treasure Hunt

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

Start Hunting!

Translated by