Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

Eror Using * Inner matrix dimensions must agreee HELP

1 visualizzazione (ultimi 30 giorni)
Isaac Al-rai
Isaac Al-rai il 28 Feb 2015
Chiuso: MATLAB Answer Bot il 20 Ago 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.

Risposte (1)

Star Strider
Star Strider il 28 Feb 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.

Questa domanda è chiusa.

Community Treasure Hunt

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

Start Hunting!

Translated by