Advertisement
TwentyEight

Function f with varying values of a Plot

Jan 12th, 2019
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.40 KB | None | 0 0
  1. t = 0 : 0.001 : pi / 2; % Create a vector of a lot of values between 0 and pi / 2
  2. % So that time appears continuous when we plot graphs
  3. figure
  4. hold on
  5. a = 1;
  6. f = a * sin(t);
  7. plot(t, f);
  8. a = 2;
  9. f = a * sin(t);
  10. plot(t, f);
  11. a = 1/2;
  12. f = a * sin(t);
  13. plot(t, f);
  14. xlabel('Time');
  15. ylabel('Function f(t)')
  16. title('Function f with varying values of a')
  17. legend('a = 1', 'a = 2', 'a = 0.5')
  18. hold off
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement