Plot 2D graph
Show older comments
Plot 2D graphs for each of the following functions on an interval [−2π, 2π]. Then plot all the graphs in the same chart and add a title to the graph. sin(x); 2sin(x);3sin(x); 5sin(x); sin(2x); sin(3x); sin(5x)
Accepted Answer
More Answers (1)
Jagar
on 16 Oct 2024
Edited: Walter Roberson
on 16 Oct 2024
x=-2*pi:0.04:2*pi;
figure;
plot(x,sin(x),'r');
hold on;
plot(x,2*sin(x),'b');
plot(x,3*sin(x),'g');
plot(x,5*sin(x),'c');
plot(x,sin(2*x),'y');
plot(x,sin(3*x),'m');
plot(x,sin(5*x),'k');
grid on;
title('Figure title');
1 Comment
Walter Roberson
on 16 Oct 2024
Categories
Find more on Line Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!