Author Topic: help with simple mtimes error  (Read 971 times)

Offline ktobrien

  • Newbie
  • *
  • Posts: 1
  • Matlab Forum
    • View Profile
help with simple mtimes error
« on: October 18, 2010, 12:52:36 AM »
Can someone please tell me why I am getting this mtimes error.  I know it has to do with matrix multiplication but I dont have any matrices in my code.  I know the problem is in the line where I define the function x.  Here is my code.
 omn = 3;
Fs = 35;
Fc = 61;
r = 2;
m = 20;
zeta = .5;
fs = Fs/m;
fc = Fc/m;
t = 0:0.5:10;
bom = r*omn;
tau = 1/(zeta*omn);
om = omn*sqrt(1-zeta^2);


 
Bs = (fs*(omn^2-bom^2)+2*fc*bom*omn*zeta)/(omn^4+2*bom^2*omn^2*(2*zeta^2-1)+bom^4)
Bc = (-(2*bom*fs*omn*zeta-fc*(omn^2-bom^2)))/(omn^4+2*bom^2*omn^2*(2*zeta^2-1)+bom^4)
As = (2*bom*fs-fc*tau*omn+fc*tau*bom^2-bom*fs*tau^2*omn-bom^3*fs*tau^2)/(om*(tau^2*(omn^2-bom^2)^2+4*bom^2))
Ac = (2*bom*fs*omn*zeta-fc*(omn^2-bom^2))/(omn^4+2*bom^2*omn^2*(2*zeta^2-1)+bom^4)

 
x = exp(-t/tau)*(Ac*cos(om*t)+As*sin(om*t))+Bs*sin(bom*t)+Bc*cos(bom*t);
plot(x,t)

Offline England90

  • Jr. Member
  • *
  • Posts: 15
  • Matlab Forum
    • View Profile
Re: help with simple mtimes error
« Reply #1 on: November 09, 2010, 04:50:39 PM »
I think this error is in how your matrix!

Matlab and SimuLink Development Forum

Re: help with simple mtimes error
« Reply #1 on: November 09, 2010, 04:50:39 PM »