plot a parabola y = x^2 in the domain [-5,4] in matlab
main.m
% Define the domain and create an array of x valuesdomain = linspace(-5, 4, 100);
% Create the parabola using element-wise operationsy = domain.^2;
% Plot the parabolaplot(domain, y);
% Label the axesxlabel('x');
ylabel('y');
% Set the titletitle('Parabola: y = x^2');
% Set the limits of the x-axis and y-axisxlim([-5, 4]);
ylim([0, 16]);
351 chars
20 lines
This code will produce a plot of the parabola y = x^2 in the domain [-5,4] with appropriate axes labels, limits, and title.