How to plot two vectors at the same time

조회 수: 1 (최근 30일)
Jonas Morgner
Jonas Morgner 2022년 4월 17일
댓글: Jonas Morgner 2022년 4월 18일
Use these variables to plot the graphical representation of the polynomial.
To that end, you must use the function plot, using two parameters, 1)
the vector created in step b and 2) the polyval function (also with two
parameters, the vectors created in steps a and b, in that order).
v1 = [1 -2 -5 6] % vector from exercise A
v2 = [-100 : .1 : 100 ] % vector from excercise B

채택된 답변

Sam Chak
Sam Chak 2022년 4월 17일
@Jonas Morgner, Do you mean llke this?
v1 = [1 -2 -5 6];
v2 = -100 : .1 : 100;
y = polyval(v1, v2);
plot(v2, y)
  댓글 수: 1
Jonas Morgner
Jonas Morgner 2022년 4월 18일
Yes that works! Thank you very much :)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Polynomials에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by