Smith university of st thomas minnesota 11 matlab

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ical Syntax: if ( expression1 ) statement1 ; elseif ( expression2 ) statement2 ; else statement3 ; end ALWAYS needs the end statement to mark the end No curly braces March 2005 R. Smith - University of St Thomas - Minnesota 12 Matlab FOR Syntax: for variable = vector statements ; end Goes through vector, element by element Assigns an element to variable The vector can be a colon statement, like 1:length(x) Runs the statements until end, then repeats ALWAYS needs the end statement to mark the end No curly braces March 2005 R. Smith - University of St Thomas - Minnesota 13 Matlab WHILE Syntax: while expression statements ; end Tests expression for non-zero result, loops if so Runs the statements until end, then repeats ALWAYS needs the end statement to mark the end No curly braces March 2005 R. Smith - University of St Thomas - Minnesota 14 Why C? Why Matlab? The exam will ask you to...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online