This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: disp('x is less than 0') case 'RoundedDownToFive' disp('x rounded downward is equal to five') otherwise disp('x is between 0 and 10') end pause % Example of for loop logic fprintf('Example of for loop logic\n') Sheet1 Page 2 for i = 1:10, if x < i fprintf('x is less than %d\n', i) break end end pause % Example of while loop logic fprintf('Example of while loop logic\n') i = 0 while x > i if x < i+1 % why did I have to say i+1? fprintf('x is less than %d\n', i+1) end i = i+1 end % Pass back x + 1 y = x+1...
View Full Document
This note was uploaded on 09/05/2011 for the course EGM 3344 taught by Professor Raphaelhaftka during the Spring '09 term at University of Florida.
- Spring '09