×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Vector in lowest integers? Floor() function not helpful

Vector in lowest integers? Floor() function not helpful

Vector in lowest integers? Floor() function not helpful

(OP)
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

RE: Vector in lowest integers? Floor() function not helpful

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: Eng-Tips.com Forum Policies

RE: Vector in lowest integers? Floor() function not helpful

A quick solution is:

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

More terms may be necessary in the denominator for a more general solution.

RE: Vector in lowest integers? Floor() function not helpful

(OP)
Thanks, PNachtwey, perfect solution to my problem!

Regards,
//Herbert

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources