MATLAB: Limit a vector value

lower limitMATLABupper limitvector

Hello!
I need help in limiting a variable vector (V) to lower limit (L) and upper limit (U) vectors, i.e. the value of the first variable in V is between L(1) and U(1). How I can do that?
Thanks in advance !

Best Answer

>> min([1 2 3],[2 0 5])
ans =
1 0 3
also see max()