Toshio
Toshio

Reputation: 133

Plotting the clamp function on wolframalpha

It's not obvious to me how to plot on wolframalpha a function that contains conditionals, the one I have in mind is:

clamp lowerBound upperBound i
  | i > upperBound = upperBound
  | i < lowerBound = lowerBound
  | otherwise      = i

Upvotes: 0

Views: 928

Answers (2)

user272237
user272237

Reputation:

clip(i, {lowerBound, upperBound})

Upvotes: 0

Unknown1987
Unknown1987

Reputation: 1701

I've used min(max(i, lowerBound), upperBound), but it does make your equation look messy.

Upvotes: 2

Related Questions