List of Commands

Control Structure/CommandDescription
forRepeat the statements specific number of times
whileRepeat the statements if the condition is true or non-zero
ifConditionally execute the statements
switchSwitch between cases depending upon the condition
breakTerminate the execution of for or while loop
continuePass the control to next iteration of for or while loop
errorDisplay message and abort function
try-catchCatch the error generated by MATLAB

Get MATLAB® and Its Applications in Engineering: [Based on MATLAB 7.5 (R2007b)] now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.