I have to do a MATLAB code for the numerical evaluation if the frequency what I did is the following but I can't figure out why I'm getting this error: the acc.dat is a file I created on notepad with acc=[0,1,0,-1,0,1,0] and time = [0,1,2,3,4,5,6]
%Steady State Response
load acc.datload time.datfs=10; T=6.4;N=fs*T;w0=(2*pi)/T;m=31744.6;k=5000000;chi=0.0511;P=(-m)*(acc); p=fft(P);wn=12.57;for j=1:N-1if j>=0 & j<=N/2w(j)=j*w0;elseif j>N/2 & j<=N-1w(j)=-(N-1)*w0;endhw(j)=(1/k)*(1/((1-(w(j)/wn)^2)+(i*(2*chi*(w(j)/wn)))));uw(j+1)=hw(j)*P(j+1);vw(j+1)=i*w(j)*hw(j)*P(j+1);endIndex exceeds matrix dimensions.
Best Answer