Posts

Showing posts with the label inequality

How to set a function that can return different value for different range in MatLab? - piecewise -- MatLab

 How to set a function that can return different value for different range in MatLab? - piecewise -- MatLab [Ans] piecewise command [Description] I think explanations of matlab help doc are I think I can not use greater way to describe --- help for sym/piecewise  --- piecewise  Conditionally defined symbolic object PW = piecewise (CONDITION1, VAL1, CONDITION2, VAL2, ..., <OTHERWISEVAL>) Create a conditionally defined symbolic object. It equals the k-th value if the k-th condition holds and the first k-1 conditions are false. If all conditions are false, it equals otherwiseVal. The final argument otherwiseVal may be omitted; it defaults to sym(NaN). In contrast to an if statement, the truth value of the conditions need not be decidable at the time the conditional object is defined. [Syntax] pw = piecewise(cond1,val1,cond2,val2,...,<otherwiseVal>) Type of <otherval> must be constant. If <otherVal> was not given...

How to set a range in symbolic variable in MatLab? - assume -- MatLab

 How to set a range in symbolic variable in MatLab? - assume -- MatLab  How to set a range in symbolic variable in MatLab? [Ans] assume command  How to set a range in symbolic variable in addition in MatLab? [Ans] assumeAlso command  How to look at current assumption of the given variable? [Ans] assumptions command assumptions [Description] take a look at current assumptions of x. [Syntax] assumptions(x) assumeAlso [Description] It is similar to assume function, but it is  additive. [Syntax] Same as assume function. assume [Description] assume function can assume  a symbolic variable between specific range or type with given expression. It uses some simple conceptions of set. When I comprehend it, I uses some simple conceptions of set. [Syntax] (1)assume(<cond>) (2)assume(<expre>,<set>) (3)assume(<expre>,'clear') (1)assume(<cond>) the state <cond> will be set to be valid. (2)assume(<expre>,<set>) the state of ...