how can i write a function with a range of values for example speed between 100 and 150.
6 views (last 30 days)
Iddo Weiner on 31 Jan 2017
I agree with Jhon, more specific details could help understanding the problem..
But 1 possibility would be throwing an error if the input value is out of range, e.g. add to the beginning of the function:
Range = [100 150];
if input_val < min(Range) || input_val > max(Range)
error('input value out of range')
This will not allow the function to run with values you do not want to treat