The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Simulink evaluation of (a<b) ? (a*a/b) : b
Replies: 6   Last Post: Apr 17, 2012 4:35 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Jason S

Posts: 57
Registered: 2/23/05
Simulink evaluation of (a<b) ? (a*a/b) : b
Posted: Apr 17, 2012 2:39 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I posted on StackOverflow ( but figured I'd ask here as well:

I have this function

f(a,b) = {
a*a/b if a < b,
b if a >= b

defined for values of a and b between 0 and 1 inclusive.

The function is continuous at all valid values of a and b in this range. (Really! try it yourself!) But I'm not sure how to evaluate it in Simulink. The problem is that I can't figure out how to restate it in a way that I could evaluate both "forks" of the function and take the min or max (e.g. min(a*a,b*b)/b) without having a divide-by-zero error at b=0, and I'd like to avoid getting into things like conditionally-executed subsystems.

Does anyone know how I might go about doing this?

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.