MATLAB HELP I also need to plot the results in one single gr

MATLAB HELP!! I also need to plot the results in one single graph. Thanks!

Consider the following function: y = f(x) = sin(x) + x^2 + 6^2 Create vectors from -10 to 10 with the following step-sizes: 5 1 0.1 0.001 0.00001

Solution

MATLAB CODE

x1=-10:5:10;

y1=sin(x1)+x1.^2+6^2;

plot(x1,y1);

hold on

x2=-10:1:10;

y2=sin(x2)+x2.^2+6^2;

plot(x2,y2);

x3=-10:.1:10;

y3=sin(x3)+x3.^2+6^2;

plot(x3,y3);

x4=-10:.001:10;

y4=sin(x4)+x4.^2+6^2;

plot(x4,y4);

x5=-10:.00001:10;

y5=sin(x5)+x5.^2+6^2;

plot(x5,y5);

MATLAB HELP!! I also need to plot the results in one single graph. Thanks! Consider the following function: y = f(x) = sin(x) + x^2 + 6^2 Create vectors from -1

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site