Info
Cette question est clôturée. Rouvrir pour modifier ou répondre.
Create a function, PlotSC, which receives two input values acting as the range to be plotted, (a,b). There will be no variable/numerical output from this function.
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Within the function, plot y = sin(x) + cos(x) for x values ranging from a to b (in the same figure window): a. Using 5 points in this range and a solid blue line with circles. b. Using 10 points in this range and a dashed-dotted black line with squares. c. Using 50 points in this range and a dashed red line with stars. Still within your function, title your plot ‘y vs. x’, label both axes as ‘x’ and ‘y’, respectively, and add a legend.
My code is function PlotSC(a,b) a=-2*pi b=2*pi x=linspace(a,b); y=sin(x)+cos(x); plot(x,y,'b')
but i dont know how to use 5, 10, 50 points.
0 commentaires
Réponses (2)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!