cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Purpose/Output of bound()

Purpose/Output of bound()

Dear all,

 

I've been translating some MatrixX simulations into Matlab and was struggling with the MatrixX function "bound()". Before I start with another strategy, like re-interpreting the blocks, I would really like to understand what this function is for... Anyone out there who n´knows?

 

In the original context, the function is used like:

 

a=bound(x,0.1,10000.);

 

Thanks in advance!

Santiago

0 Kudos
Message 1 of 2
(4,377 Views)

Re: Purpose/Output of bound()

bound() places limits on the value of the first input, so in your example

 

a=bound(x,0.1,10000.);

 

in pseudocode;

 

if( x < 0.1)

  a = 0.1

else if(x > 10000)

  a = 10000

else

 a = x

end

0 Kudos
Message 2 of 2
(4,273 Views)