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:
solve quadratic equation in matlab

Subject: solve quadratic equation in matlab

From: Cecilia

Date: 30 Jul, 2014 12:07:10

Message: 1 of 5

Hi.
Can I solve this quadratic equation in Matlab? If so, how?
(A - X)*B*(A - X)' = 1

A = [a1 a2 a3] and B is a 3x3-matrix. A and B are known. And X = [x x x] is unknown.

Thank you

Subject: solve quadratic equation in matlab

From: Bruno Luong

Date: 30 Jul, 2014 13:21:07

Message: 2 of 5

"Cecilia " <ceciliaf@stud.ntnu.no> wrote in message <lran5e$db1$1@newscl01ah.mathworks.com>...
> Hi.
> Can I solve this quadratic equation in Matlab? If so, how?
> (A - X)*B*(A - X)' = 1
>
> A = [a1 a2 a3] and B is a 3x3-matrix. A and B are known. And X = [x x x] is unknown.

There are infinity solutions. Fors example if A = [0 0 0] and B = eye(3), any X on unit sphere is a solution.

Bruno

Subject: solve quadratic equation in matlab

From: Christopher Creutzig

Date: 31 Jul, 2014 09:19:55

Message: 3 of 5

On 7/30/14 2:07 PM, Cecilia wrote:
> Hi.
> Can I solve this quadratic equation in Matlab? If so, how?
> (A - X)*B*(A - X)' = 1
>
> A = [a1 a2 a3] and B is a 3x3-matrix. A and B are known. And X = [x x x] is unknown.

>> syms x
>> A = [1 2 3];
>> B = magic(3);
>> X = [x x x];
>> solve((A - X)*B*(A - X)' == 1, x)

ans =

 2 - 5^(1/2)/15
 5^(1/2)/15 + 2

>> double(ans)

ans =

    1.8509
    2.1491



HTH,

Christopher

Subject: solve quadratic equation in matlab

From: Cecilia

Date: 31 Jul, 2014 10:57:10

Message: 4 of 5

Christopher Creutzig <Christopher.Creutzig@mathworks.com> wrote in message <53DA0A3B.6060107@mathworks.com>...
> On 7/30/14 2:07 PM, Cecilia wrote:
> > Hi.
> > Can I solve this quadratic equation in Matlab? If so, how?
> > (A - X)*B*(A - X)' = 1
> >
> > A = [a1 a2 a3] and B is a 3x3-matrix. A and B are known. And X = [x x x] is unknown.
>
> >> syms x
> >> A = [1 2 3];
> >> B = magic(3);
> >> X = [x x x];
> >> solve((A - X)*B*(A - X)' == 1, x)
>
> ans =
>
> 2 - 5^(1/2)/15
> 5^(1/2)/15 + 2
>
> >> double(ans)
>
> ans =
>
> 1.8509
> 2.1491
>
>
>
> HTH,
>
> Christopher
Perfect.
Thank you<3

Subject: solve quadratic equation in matlab

From: Cecilia

Date: 31 Jul, 2014 11:33:10

Message: 5 of 5

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <lrarg2$p6f$1@newscl01ah.mathworks.com>...
> "Cecilia " <ceciliaf@stud.ntnu.no> wrote in message <lran5e$db1$1@newscl01ah.mathworks.com>...
> > Hi.
> > Can I solve this quadratic equation in Matlab? If so, how?
> > (A - X)*B*(A - X)' = 1
> >
> > A = [a1 a2 a3] and B is a 3x3-matrix. A and B are known. And X = [x x x] is unknown.
>
> There are infinity solutions. Fors example if A = [0 0 0] and B = eye(3), any X on unit sphere is a solution.
>
> Bruno
Thank you:)

Tags for 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