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!

Vector in lowest integers? Floor() function not helpful 1

Status
Not open for further replies.

Gulliveig

Computer
Joined
Aug 21, 2008
Messages
2
Location
CH
Good day,

Suppose I have a 2 rows x 1 col "matrix" named v, e.g.:
1
-5/6

Now I want this vector in lowest integers, i.e.:
6
-5

However, it seems to be difficult to achieve this. I tried to apply this to an ordinary scalar fraction in a solve block, like follows, in the hope to eventually get the factor n with which to multiply the vector's components:

Given
Floor(n*3/4)=n*3/4
n>0
Find(n) ->

I'd expect n=4 here, but: Mathcad complains, and says that the constraint is not valid. Would I omit the constraint, then it would find 0, which although correct is not of much use here.

Any suggestions, also completely different approaches?
Thanks in advance for your replies.

Regards,
//Herbert

PS: Using Mathcad 2001i Professional
 
Seems to me that Excel is more suitable than Mathcad is for this. You could convert to string, and parse out the denominators

TTFN

FAQ731-376
 
A quick solution is:

v*1/(|max(v)|-|min(v)|)

More terms may be necessary in the denominator for a more general solution.
 
Thanks, PNachtwey, perfect solution to my problem!

Regards,
//Herbert
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top