Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

why the symbolic vector minus a scalar vector produce a vector with fraction?

Status
Not open for further replies.

Sacaq

Mechanical
Joined
Nov 4, 2014
Messages
42
Location
TW
Hi~

When I try to solve some equations, I found the solution was all fractions.
check the value of each vector, I found where the situation start.
The codes are like this:

A12=[5.5,398,455]
syms a b c
A=[a,b,c]
AA12=A12-A

and the output were:

A12 =
5.5000 398.0000 455.0000

A =
[ a, b, c]

AA12 =
[ 11/2 - a, 398 - b, 455 - c]

After I use the function "solve" to solve the equations, the solution matrix is full of fractions.
 
OK, I found a solution.
just like this:

A=double(A)

It seems the glitch is the format.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top