Create an m-script file to plot the following functions separately

4 visualizaciones (últimos 30 días)
I am trying to plot the following function in Matlab. y=x^3+2x^2-6x with x having bounds of 0 to 30 (0:30)
I am using the following code and below is the error message I am receiving x=0:30; >> plot(x,'x.^3+2x.^2-6x'),grid Error using plot Error in color/linetype argument
If someone could please help me to fix this error and/or see the error in my function I would appreciate it.

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 27 de En. de 2014
Editada: Azzi Abdelmalek el 27 de En. de 2014
x=0:30;
plot(x,x.^3+2*x.^2-6*x)
grid
xlabel('x')
ylabel('y')
title('y=x.^3+2*x.^2-6*x')
For more details look at
doc plot

Más respuestas (1)

Rohit Naik
Rohit Naik el 28 de Ag. de 2021
X = [-10:10]; Y = tan^-1(X) Plot(X,Y)

Categorías

Más información sobre Formatting and Annotation en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by