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:
Formal Calcul

Subject: Formal Calcul

From: Etienne Rousee

Date: 6 May, 2011 16:30:27

Message: 1 of 2

Hello everybody,

After:

>> syms a,b;

With:

>> factor(a^2-2*a+1)

I obtain that correct answer :

ans =

(a - 1)^2

But with

>> factor(a^-2*a*b+b^2)

I obtain :

ans =

(b*(a*b + 1))/a

This is not that I want.

How to do ?

And I have more complicated expressions, but
always polynoms or polynomials fractions in
2 or 3 variables.

--

Etienne

Subject: Formal Calcul

From: Roger Stafford

Date: 6 May, 2011 16:58:05

Message: 2 of 2

Etienne Rousee <etienne@rousee.org> wrote in message <iq17no$oh3$1@talisker.lacave.net>...
> .......
> >> factor(a^-2*a*b+b^2)
> I obtain :
> ans =
> (b*(a*b + 1))/a
> ........
- - - - - - - -
  That is the correct factorization of the expression as you have written it. I suspect that you intended to write:

 factor(a^2-2*a*b+b^2)

which would give a different answer.

Roger Stafford

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