plot the polynomial y=18𝑥^3 − 5𝑥^2− 2𝑥 +3 over the range −7 ≤ x ≤ 1. in matlab

main.m
% Define the polynomial function
y = @(x) 18*x.^3 - 5*x.^2 - 2*x + 3;

% Define the range of x values
x = -7:0.1:1;

% Calculate the corresponding y values
y_values = y(x);

% Plot the polynomial
plot(x, y_values);
xlabel('x');
ylabel('y');
title('Plot of polynomial y = 18x^3 - 5x^2 - 2x + 3');
296 chars
15 lines

related categories

gistlibby LogSnag