cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Could you give me a method to restrick vector's values?

jlee-2
7-Bedrock

Could you give me a method to restrick vector's values?

35.PNG

I want "omega" to restrict 12.1rpm.

So I tried such as a upper picture.

But I got error. I can't understand why I got error.

could you help me?

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:jlee-2)

You may use a small auxiliary function whch you then call vectorized:

1.png

View solution in original post

11 REPLIES 11
Werner_E
25-Diamond I
(To:jlee-2)

You may use a small auxiliary function whch you then call vectorized:

1.png

jlee-2
7-Bedrock
(To:Werner_E)

Oh Thank you very much.

But I wonder why I got error when I tried

Werner_E
25-Diamond I
(To:jlee-2)

You can't compare a vector to a scalar. In fact - you can, but the result will be a vector consisting of zeros and ones which is invalid as condition in the if function.

1.png

jlee-2
7-Bedrock
(To:Werner_E)

36.PNG

But It is ok.

I can't understand why

Werner_E
25-Diamond I
(To:jlee-2)

I don't see what your function P returns but if it works then I guess its a scalar value and not a vector.

jlee-2
7-Bedrock
(To:Werner_E)

okay I see.

Finally I have a question.

Is it possible following?

limit(x,X,Y):=if(Y<x<X , x, X, Y)

StuartBruff
23-Emerald III
(To:jlee-2)

jinsuk Lee wrote:

okay I see.

Finally I have a question.

Is it possible following?

limit(x,X,Y):=if(Y<x<X , x, X, Y)

Not quite, because the if function only takes 3 arguments and you have 4 argument. You also need to define the condition for when to choose X or Y. There are a few ways you could do it. For example,

limit(x,X,Y):=if(Y<x<X,x,if(x>Y,X,Y)

or

limit(x,X,Y):=if(x>Y, (if x<X,x,X), Y)

I'd probably put Y before X in the function's arugment list, as it's conventional to put the lower limit first.

I think the Limit function I posted will do what you want, though.

Stuart

thank you very much~

StuartBruff
23-Emerald III
(To:jlee-2)

No problem.

Stuart

StuartBruff
23-Emerald III
(To:Werner_E)

Here's another I sometimes use (in M15 not Prime, and short enought that it's probably quicker and more convenient to type the function rather than convert it to Prime) ...

collab+-+14+12+22+limiting+matrix+values+01.JPG

Stuart

Thankyou for helping

Announcements

Top Tags