# matlab programming/error messages

#### chrill3123

Joined Apr 21, 2010
9
My function in matlab is:

t=0:0.01:8;
w=1;
y=1-((exp(-0.6*w*t))/(sqrt(1-0.6^2)))*sin(w.*sqrt(1-0.6^2)+acos(0.6));
plot(t,y);
hold on;
w=5;
y=1-((exp(-0.6*w*t))/(sqrt(1-0.6^2)))*sin(w.*sqrt(1-0.6^2)+acos(0.6));
plot(t,y)

but every time I´ll run it I get the following message:

??? Error using ==> mtimes
Inner matrix dimensions must agree.
Error in ==> Analytiskt_w0_w5 at 3
y=1-((exp(-0.6*ω*t))/(sqrt(1-0.6^2)))*sin(ω.*t.*sqrt(1-0.6^2)+acos(0.6));

I don´t see where I do wrong

Any help is appreciated

#### Georacer

Joined Nov 25, 2009
5,182
Your code works to me in Matlab R2010b and its output graph is attached.

#### Attachments

• 15 KB Views: 10

#### Chrill3

Joined Mar 8, 2010
9
Your code works to me in Matlab R2010b and its output graph is attached.

Iam sorry I gave you the wrong function the correct one is, and with this I get the error message from matlab:

My function in matlab is:

t=0:0.01:8;
w=1;
y=1-((exp(-0.6*w*t))/(sqrt(1-0.6^2)))*sin*t*(w.*sqrt(1-0.6^2)+acos(0.6));
plot(t,y);
hold on;
w=5;
y=1-((exp(-0.6*w*t))/(sqrt(1-0.6^2)))*sin*t*(w.*sqrt(1-0.6^2)+acos(0.6));
plot(t,y)

#### Georacer

Joined Nov 25, 2009
5,182
That doesn't make much sense, now, does it? What is the meaning of the multiplication sin*t. Did you mean sin(t*...)?