> For i=1:numel(t_vec) > y(1)=Y(i,1); > y(2)=Y(i,2); > y(3)=Y(i,3); > y(4)=Y(i,4); > t=t_vec(i); > dy=vib_equ(t,y,c_s_f,c_s_r,v_val,F_d_val,m_c,I_g_c,l,l_f,l_r,u_f,u_f_dot,v,L,i_d); > Y_acc(i,1) = dy(2); > Y_acc(i,2) = dy(4); > end > > does not work ? > > (Of course you will have to supply the correct values for the variables in your calling list to vib_equ) > > Or use the OutputFcn facility during the computation with ode45. > > Best wishes > Torsten.
Thank you again for your answer!
I understand your code, however I have a matrix dimension error now. Here's what it looks like inside the function: function dy = vib_equ(t,y,c_s_f,c_s_r,v_val,F_d_val,m_c,I_g_c,l,l_f,l_r,u_f,u_f_dot,v,L,i_d);