Plot the function f(x) = x^4 - 3x^3 + 10x^2 - 2 for - 6 < x < 6. Draw the function as a solid black 2-point-wide line, and turn on the grid. Be sure to include a title and axis labels, and include the equation for the function being plotted in the title string.

Respuesta :

Matlab Code with Explanation:

x = -6:0.01:6  % time vector from -6 to 6 in steps of 0.01

fx = x.^4 - 3*x.^3 + 10*x.^2 - 2;  % the equation of function f(x) where dot represents bit wise operation

plot(x, fx, 'k', 'linewidth',  2);  % to plot f(x) with respect to x and 'k' is for black color and linewidth for thickness

grid on   % turn on grids

xlabel('x') % to label the of x-axis

ylabel('f(x)')  % to label the of y-axis

title('f(x)=x^4-3x^3+10x^2-2') % title of the plot

Output Results:

Please refer tot he attached image

Ver imagen nafeesahmed