Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Rank of root

Subject: Rank of root

From: Triet

Date: 29 Dec, 2012 07:58:07

Message: 1 of 3

I know Matlab has "factor" to factor an equation, but is there any function or any way to do this in Matlab:
-Input: an equation ex: x^3 -8*x^2 + 20*x -16
-Output:
+the equation factored, ex: (x - 4)*(x - 2)^2
+Solve the equation, ex: x1=4; x2=2
+Most important: show the rank of each root (the power of each inner expression) , ex: root 1 = 4 has rank = 1; root 2 = 2 has rank = 2

Subject: Rank of root

From: Roger Stafford

Date: 29 Dec, 2012 17:56:11

Message: 2 of 3

"Triet" wrote in message <kbm7qf$bn2$1@newscl01ah.mathworks.com>...
> I know Matlab has "factor" to factor an equation, but is there any function or any way to do this in Matlab:
> -Input: an equation ex: x^3 -8*x^2 + 20*x -16
> -Output:
> +the equation factored, ex: (x - 4)*(x - 2)^2
> +Solve the equation, ex: x1=4; x2=2
> +Most important: show the rank of each root (the power of each inner expression) , ex: root 1 = 4 has rank = 1; root 2 = 2 has rank = 2
- - - - - - - - -
  Besides the symbolic 'factor' there is the numeric 'roots' function from which you can obtain the above information by comparing the polynomial's roots. For a polynomial with real coefficients a pair of roots which are complex conjugates of one another will give you a quadratic factor. Note that roots which are equal may suffer slightly differing round-off errors so your comparisons should have a tolerance for small differences.

Roger Stafford

Subject: Rank of root

From: Triet

Date: 29 Dec, 2012 18:32:13

Message: 3 of 3

"Roger Stafford" wrote in message <kbnarq$302$1@newscl01ah.mathworks.com>...
> "Triet" wrote in message <kbm7qf$bn2$1@newscl01ah.mathworks.com>...
> > I know Matlab has "factor" to factor an equation, but is there any function or any way to do this in Matlab:
> > -Input: an equation ex: x^3 -8*x^2 + 20*x -16
> > -Output:
> > +the equation factored, ex: (x - 4)*(x - 2)^2
> > +Solve the equation, ex: x1=4; x2=2
> > +Most important: show the rank of each root (the power of each inner expression) , ex: root 1 = 4 has rank = 1; root 2 = 2 has rank = 2
> - - - - - - - - -
> Besides the symbolic 'factor' there is the numeric 'roots' function from which you can obtain the above information by comparing the polynomial's roots. For a polynomial with real coefficients a pair of roots which are complex conjugates of one another will give you a quadratic factor. Note that roots which are equal may suffer slightly differing round-off errors so your comparisons should have a tolerance for small differences.
>
> Roger Stafford


Thank you. That helped me very much.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us