How do I limit the input numbers to 1 through 10?

3 views (last 30 days)
Hi, I need to know, how I can limit the input numbers to 1 trough 10. So I can make 6 inputs and get the average of them.

Answers (1)

Matt J
Matt J on 16 Nov 2015
newinput = max(min(input,10),1)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!