How can I zoom into my plot function to a -4 to 4 "interval".

1 Ansicht (letzte 30 Tage)
Jonas Morgner
Jonas Morgner am 9 Mai 2022
Beantwortet: KSSV am 9 Mai 2022
v1 = [1 -2 -5 6];
v2 = [-100 : .1 : 100];
y = polyval (v1, v2);
plot (v2, y)
How can I zoom in the plot function from -4 to 4?
  1 Kommentar
Mishka
Mishka am 9 Mai 2022
You can set the limits of x-axis inside the plot with the command xlim(). In this case, xlim([-4 4]) should do the job.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

KSSV
KSSV am 9 Mai 2022
v1 = [1 -2 -5 6];
v2 = [-100 : .1 : 100];
y = polyval (v1, v2);
plot (v2, y)
xlim([-4 +4])

Kategorien

Mehr zu Data Exploration 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