Write a programme to plot the function f(x)=xsin(pi(9x+1)) over the interval [−1, 1] using increments in x of (a) 0.2, (b) 0.1, and (c) 0.01. The programme should plot the three graphs in the same figure. Include the legend to specify which graph corresponds to which increment. (Observe that the plots for cases (a) and (b) givetotally the wrong picture of ݂f(x)).
Could someone help me?
x = linspace(0.2:0.1:0.01);
y = x*sin(pi*(9*x+1));
y=[-1:1]
figure
plot(x,y)
3 Comments
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/507762-plotting-3-graphs-in-the-same-figure#comment_802703
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/507762-plotting-3-graphs-in-the-same-figure#comment_802703
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/507762-plotting-3-graphs-in-the-same-figure#comment_802721
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/507762-plotting-3-graphs-in-the-same-figure#comment_802721
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/507762-plotting-3-graphs-in-the-same-figure#comment_807614
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/507762-plotting-3-graphs-in-the-same-figure#comment_807614
Sign in to comment.