Aaron's Octave Assignment

From Class Wiki
Revision as of 09:35, 4 October 2010 by Aaron.boyd (talk | contribs) (Created page with 'Just like C++ Octave and Matlab recognize if statements. if (%your condition%) %your command%; else %your command%; end More complex systems can use the elseif command i…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Just like C++ Octave and Matlab recognize if statements. if (%your condition%)

  %your command%;

else

  %your command%;

end

More complex systems can use the elseif command

if (%condition%) elseif (%condition%)

 %commands%;

elseif(%condition%)

 %commands%;

else(%condition%)

  %commands%;

end

for instance

if (a=b)

  t = -1;

elseif (a>b)

  t = -2;

else

  t = 0;

end