Hello,
After subtracting two vectors, how do i set the element value to zero if it is negative? P9 sheet is attached.
Thanks,
Sam
Solved! Go to Solution.
In case you need it more often to limit a value or a vector of values between two limits, you may use a small utility function.
In your case you have to use vectorization and use the limits zero and infinity.
In case you use units, don't forget to apply the appropriate units to the limits as well (even if its infinity).
Of course you always can use programming (even thought it may be considered overkill here
And even though I don't like this kind of approach, what you can do with for loops most often also could be done using range variables:
Prime 9 sheet attached
Here's one way:
Thank you, Alan!
In case you need it more often to limit a value or a vector of values between two limits, you may use a small utility function.
In your case you have to use vectorization and use the limits zero and infinity.
In case you use units, don't forget to apply the appropriate units to the limits as well (even if its infinity).
Of course you always can use programming (even thought it may be considered overkill here
And even though I don't like this kind of approach, what you can do with for loops most often also could be done using range variables:
Prime 9 sheet attached
Thank you for the different alternatives. Werner!
I used your solution.