Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
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?
Solved! Go to Solution.
You may use a small auxiliary function whch you then call vectorized:
You may use a small auxiliary function whch you then call vectorized:
Oh Thank you very much.
But I wonder why I got error when I tried
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.
But It is ok.
I can't understand why
I don't see what your function P returns but if it works then I guess its a scalar value and not a vector.
okay I see.
Finally I have a question.
Is it possible following?
limit(x,X,Y):=if(Y<x<X , x, X, Y)
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~
No problem.
Stuart
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) ...
Stuart
Thankyou for helping