Skip to main content
Logo image

Chapter 7 Logic

MATLAB has all the branching and looping constructs of C, however, the syntax is slightly different. Here is a list of what MATLAB has available:
Branch Statements:
  • if-end
    
  • if-else-end
    
  • if-elseif-else-end
    
  • switch-case
    
Loops:
  • for-end
    
  • while-end