Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function plotslope
- x=-1:0.3:4;
- y=2-:0.3:3;
- axis([-1,4,-2,3])
- function z = ff(x,y)
- z = (1+y)*cos(3*x+pi/7);
- end
- hold on
- delta =0.1;
- for k=1:length(x)
- for m=1:length(y)
- plot(x(k),y(m),'k')
- eps=delta/(sqrt(1+ff(x(k),y(m))^2));
- plot([x(k)-eps,x(k)+eps],[y(m)-eps*ff(x(k),y(m)),y(m)+eps*ff(x(k),y(m))],'b')
- end
- end
- [x0,y0]=ginput(1);
- diff_eq=dsolve('Dy=(1+y)*cos(3*x+pi/7)','y(x0)=y0','x');
- x=-1:0.3:4;
- plot(x,eval(diff_eq),'r')
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement