Advertisement
Guest User

HW1

a guest
Feb 17th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.44 KB | None | 0 0
  1. % Define x
  2. x= linspace(-1,1,70);
  3.  
  4. % Define y1
  5. y1= ((sin((pi)*x))/1+(x.^2));
  6.  
  7. %Define y2
  8. y2= (1/1+(x.^2));
  9.  
  10. % Define y3
  11. y3= -1/1+(x.^2);
  12.  
  13. % Plot y1
  14. plot (x,y1,'b-');
  15. hold on
  16.  
  17. % Plot y2
  18. plot (x,y2,'r--');
  19.  
  20. % Plot y3
  21. plot (x,y3,'g--');
  22. hold off
  23.  
  24. % Add Legend
  25. legend('y1 equation','y2 equation','y3 equation');
  26.  
  27. % Label X-axis
  28. xlabel('x axis')
  29.  
  30. % Label Y-axis
  31. ylabel('y axis')
  32.  
  33. % Add title
  34. title(' Y Function Graph ')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement