Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
Jason S
Posts:
57
Registered:
2/23/05
|
|
Re: Simulink evaluation of (a<b) ? (a*a/b) : b
Posted:
Apr 17, 2012 3:04 PM
|
|
> I "know nuthink" about Simulink per se, but why not just special case > b==0, too?
I can't special-case anything without using a conditionally-executing subsystem (I don't want to go there... if you care, see http://www.mathworks.com/help/toolbox/simulink/slref/if.html) or a MATLAB function evaluation (slow). It's not just a matter of simply doing an "if" statement. I can use min() and max() because they are predefined functions with no branches (or rather, the branches are taken care of inside the blocks).
> I presume a>=0 must also be a reqm't or the branch a^2/b could be taken > for b=0 legitimately...
Yes, a and b are both within the range [0,1] inclusive.
|
|
|
|