Hello
I am trying to run the following code. But I keep getting the following error message, and can't figure out what I am duing wrong.
??? Error using ==> quad at 80 The integrand function must return an output vector of the same length as the input vector.
My code:
t_theta_nul=tid(0.)function res2=tid(theta_noget)h=3510;dx_dtheta=@(theta) 1/2*h*(1-cos(theta));dy_dtheta=@(theta) -1/2*h*sin(theta);f1=@(theta) sqrt((dx_dtheta(theta)).^2+(dy_dtheta(theta)).^2);s=@(theta_noget) quad(f1,theta_noget,pi);g=9.816;d=@(theta) 1/2*h*(cos(theta)+1)-(1/2*h*(cos(theta_noget)+1));f2=@(theta) sqrt(2*g*d);f3=@(theta) f1./f2;t=@(theta_noget) quad(@(theta) f3,theta_noget,pi);res2=t(theta_noget);
Best Answer