![]()
Module 3: User Defined Functions
Extending your learning.
A sample "input checking" routine you can use to start exploring some new programming constructs and m-file functions. This will be our direction of exploration for the next few weeks in MATLAB. These example involve many new constructs and we will cover these in lecture soon, I want you to have a "short" example of some very "useful" constructions for validating the user input. So this is all new material.testit.m (MATLAB M-file script)
This m-file script involves logical tests (Text Section 3.5), if-else tests and uses the user-defined function getinput below..getinput.m (MATLAB M-file function to prompt for valid input
This m-file function has 4 inputs, 2 output and uses the while and break command (from Text Section 3.5).