Hello!
So I am attempting to determine the response of an under-damped system (There is a spring, Mass and damper in the system). I have an error in my response function, x(t) that I cant seem to figure out. The error is as follows:
Error using * Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To perform elementwise multiplication, use '.*'
Here is my Response Function:
And here is My command Window with the error:
%%Damped Response
c = 8; Dampinging Coefficientm = 2; Massk = 16 Spring Constantx0 = 1 Xxd0 = -1 X Dotwn = sqrt(k/m) Natural Frequencyzeta = c/2/m/wn;B = x0;A = (xd0 + zeta*wn*x0)/wn/sqrt(1-zeta^2);C = sqrt(A^2+B^2);x = DampedResponse(zeta,wn,A,B,t);figure; plot(t,x,t,C*exp(-zeta*wn*t),'--r',t,-C*exp(-zeta*wn*t),'--r'); grid on;if true % code
endResponse Function For my System:function x = DampedResponse(zeta,wn,A,B,t)wd = wn*sqrt(1-zeta^2);x = exp(-zeta*wn*t)*(A*sin(wd*t)+B*cos(wd*t));end
Best Answer