Educational: Validating User Inputs (numbers and strings)

error checking, user stopping, validating user inputs


Updated 27 Nov 2021

View License

This code is explained in the following YouTube Video:
While Loops - Validate User Input:
In this video I cover how to code while loops in MATLAB and how these can be used to control the type of information your user must provide to continue in the code (user stopping, error checking, validating user input). I provide two main demonstrations: 1. error checking a number (whole, positive number less than or equal to 157) and 2. error checking a string (yes or no).
For more of my YouTube Videos, check out my MATLAB tutorial playlist:
Also subscribe to my channel (Engineering with Dr. Kelsey Joy):

Cite As

Dr. Kelsey Joy (2023). Educational: Validating User Inputs (numbers and strings) (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2021b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes