User Tools

Site Tools


octave:octave

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
octave:octave [2008/07/11 17:30] devaoctave:octave [2008/08/06 15:45] deva
Line 1: Line 1:
 =====Octave syntax and library overview===== =====Octave syntax and library overview=====
 +
 +====function====
 +<code matlab>
 +function retval = myfunction(param1, param2)
 +  retval = param1 + param2;
 +end;
 +</code>
 +
 +====string array====
 +<code matlab>
 +myarray = { 'hello', 'world' };
 +
 +</code>
 +
 ====if then else==== ====if then else====
 <code matlab> <code matlab>
Line 39: Line 53:
 case {"No" "no" "NO" "n" "N"} case {"No" "no" "NO" "n" "N"}
   value = 0;   value = 0;
 +case "blah"
 +  value = 42;
 otherwise otherwise
   error ("invalid value");   error ("invalid value");
 endswitch endswitch
 </code> </code>
 +Note: In matlab the ''endswitch'' should be replaced by ''end''
  
 ====Links==== ====Links====
octave/octave.txt · Last modified: 2009/04/23 13:54 by deva