You are on page 1of 1

>> m=3;

>> tmin=0;tmax=10;

>> t=[tmin,tmax];

>> x0=0;

>> y0=0;

>> v0=3.4;

>> alfa=pi/4;

>> v0x=v0*cos(alfa);

>> v0y=0*sin(alfa);

>> u0=[x0,y0,v0x,v0y];

>> [t,u]=ode45(@fun1,t,u0);

>> plot(t,u(:,1),'k-')

>> hold on

>> plot(t,u(:,2),'r-')

>> figure(2);

>> hold on;

>> plot(t,u(:,3),'b-.');

>> plot(t,u(:,4),'k-');

>> v=sqrt(u(:,3).^2+u(:,4).^2);

>> plot(t,v,'gx');

>>

You might also like