Correct Data Points Incorrect Plotting

5 Ansichten (letzte 30 Tage)
Darwin Tuazon
Darwin Tuazon am 15 Mai 2019
Kommentiert: Adam Danz am 15 Mai 2019
I just started my course in MATLAB.
I got the correct data points but it does not reflect on my graph.
Please Help. Thank you very much
clear;
clc;
count=0;
for x=-100:0.1:100
y= x^3-x-3;
count=count+1;
y_1(count)=y;
x_1(count)=x;
end
plot(x_1,y_1,'LineWidth',2)
grid on
  1 Kommentar
Adam Danz
Adam Danz am 15 Mai 2019
What makes you think your data are not commensurate with your plot?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Star Strider
Star Strider am 15 Mai 2019
The plot is correct. Note the at the upper end of the y-axis. Your y-values go from -999903 to 999897, or from about to .

Kategorien

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

Community Treasure Hunt

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

Start Hunting!

Translated by