Graph function problem Incorrect values

Hello,
I have this function, If I want to produce a graph in the range of 0<x<50 it does not give a correct answer of y. Thanks for the helpers
x=1
y=-x.^3+3*x.^2+2*x-27
y =
-23
%%plot
x=[0:50];
y=-x.^3+3*x.^2+2*x-27;
plot(x,y)

 Akzeptierte Antwort

Chunru
Chunru am 28 Jul. 2022

0 Stimmen

What's wrong?
x=[0:50];
y=-x.^3+3*x.^2+2*x-27;
plot(x,y)

3 Kommentare

Emilia
Emilia am 28 Jul. 2022
See in the answer above if I set x=1 to be y=-23 but the graph doesn't show me that.
Chunru
Chunru am 28 Jul. 2022
The y axis scale is x10^4. If you zoom in, you will see the correct value.
Emilia
Emilia am 28 Jul. 2022
Yes, you're right, I didn't notice. Thank you! :)

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Hilfe-Center und File Exchange

Produkte

Tags

Gefragt:

am 28 Jul. 2022

Kommentiert:

am 28 Jul. 2022

Community Treasure Hunt

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

Start Hunting!

Translated by