# Typing polynomial with multiple constants

조회 수: 2 (최근 30일)
endah . 2012년 9월 18일
Dear Matlab user,
I am a beginner in Matlab. I am trying to make a loop to build polynomials with different constant which each equation has solution.
x1^2-3x1+1=0 x2^2+5x2+2=0 . . xn^2-6xn+n=0
would you help me about the code ? Thanks

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

### 채택된 답변

Javier 2012년 9월 18일
편집: Javier 님. 2012년 9월 18일
Hello Endah
Procedure 1 (no poly function)
To write polynomial function and evaluate in some interval of X1
X=feval(@(x1)(x1.^2-3*x1+1),[0:1:10])
Procedure 2 (poly function)
root=[2 3 4]; %This is the polynomial equation 2X1^2 + 3X1 +4
%evaluate in number between 0 and 10 increments of 1
XX=polyval(root,[0:1:10]);
If need more help please let us know
Best regards and welcome to Matlab world
Javier
##### 댓글 수: 1이전 댓글 -1개 표시이전 댓글 -1개 숨기기
endah 2012년 9월 18일
thanks Javier

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

### 카테고리

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

### Community Treasure Hunt

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

Start Hunting!