필터 지우기
필터 지우기

Create a diagram with 3 polynomials

조회 수: 1 (최근 30일)
Berkay
Berkay 2022년 8월 30일
댓글: Star Strider 2022년 8월 30일
I have defined 3 polynomials
P1 = [ 1 -2 -15]
P2 = [1 -7 12]
P3 = [1 1 -14 -24]
I want to generate a graph that will present the shape of all polynomials in range from -100 to 100 with specific description(the logarithmic axes)
How can I do it?

채택된 답변

Star Strider
Star Strider 2022년 8월 30일
I am not certain wht you want with ‘logarithmic axes’ so this creates both as logarithmic —
P1 = [ 1 -2 -15];
P2 = [1 -7 12];
P3 = [1 1 -14 -24];
x = linspace(-100, 100, 250);
V1 = polyval(P1,x);
V2 = polyval(P2,x);
V3 = polyval(P3,x);
figure
plot(x, [V1;V2;V3])
Ax = gca;
Ax.XScale = 'log'; % Logarithmic X-Axis
Ax.YScale = 'log'; % Logarithmic Y-Axis
grid
Warning: Negative data ignored
It may be best to only have the x-axis be logarithmic, and if so, consider using logspace instead of linspace.
.
  댓글 수: 4
Berkay
Berkay 2022년 8월 30일
thanks a lot man!!
Star Strider
Star Strider 2022년 8월 30일
As always, my pleasure!

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

추가 답변 (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