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:
Symbolic factor out of a vector

Subject: Symbolic factor out of a vector

From: Joerg Buchholz

Date: 18 Nov, 2011 12:12:07

Message: 1 of 4

Matlab automatically expands the product of a scalar and a vector:

>> syms a b c d
>> v = a*[b c d]
 
v =
 
[ a*b, a*c, a*d]

Is there a command to get back to a*[b c d]?

Subject: Symbolic factor out of a vector

From: Christopher Creutzig

Date: 22 Nov, 2011 09:58:15

Message: 2 of 4

On 18.11.11 13:12, Joerg Buchholz wrote:
> Matlab automatically expands the product of a scalar and a vector:
>
>>> syms a b c d
>>> v = a*[b c d]
>
> v =
>
> [ a*b, a*c, a*d]
>
> Is there a command to get back to a*[b c d]?

No, at least not in general. The system would go back to the expanded
form first chance it gets, anyway, pretty much the same way it would for
1+1.

Just curious: What's your intention; why do you want the factored form?


Christopher

Subject: Symbolic factor out of a vector

From: Joerg Buchholz

Date: 22 Nov, 2011 10:22:08

Message: 3 of 4

Christopher Creutzig <Christopher.Creutzig@mathworks.com> wrote in message <4ECB7237.8020908@mathworks.com>...
:
> Just curious: What's your intention; why do you want the factored form?
:

The factored form is shorter and gives more immediate insight into the structure of the expression; especially if the factor is long. Most textbooks and teachers advise the students to factor out if possible.

Jörg

Subject: Symbolic factor out of a vector

From: Harry

Date: 23 Nov, 2011 20:56:08

Message: 4 of 4

I experience a similar problem. I am trying to use mupad for physics.

My intention is to have a notebook with symbolic formulas for learning and understanding the theory.
In addition I want to use the capabilities of mupad for deduction of specialized formulas from theory for my project.

I found: The output of mupad is correct in a mathematical way. However, I cannot see the physics behind the formulas.

Example: Set up a vector equation:
assume([x, y, z, x0, y0, z0, kx, ky, kz], Type::Real)
r := matrix([x, y, z]); r0 := matrix([x0, y0, z0]); k := matrix(1, 3, [kx, ky, kz])

Now the vector equation:
linalg::scalarProduct(r - r0, k), [x, y, z] = 0

I found no way to get just a symbolic scalar product. The output of mupad is hardly usuable for further symbolic computation with more complex formulas.

There seems to be no control for some kind of symbolic physics. However, perhaps I just expect too much or I choosed the wrong program.

I am considering to use a formula editor, like that of OpenOffice, and do most symbolic computations by myself. There is still an advantage over pencil and paper: the possibility to re-use terms by copy and paste, and of course, good print-out.

Mupad could still contribute to my project by performing complex computations, either for control of my own solutions or finding solutions, which I do not see.

Harry

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