octave:octave
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
octave:octave [2008/08/06 16:09] – deva | octave:octave [2009/03/29 13:52] – deva | ||
---|---|---|---|
Line 1: | Line 1: | ||
=====Octave syntax and library overview===== | =====Octave syntax and library overview===== | ||
+ | ====plotting==== | ||
+ | <code matlab> | ||
+ | h = [1, | ||
+ | plot(h); | ||
+ | xlabel(" | ||
+ | print(" | ||
+ | </ | ||
+ | This code plots a a vector with a label on the x-axis, and exports it to a pdf file. | ||
====function==== | ====function==== | ||
Line 28: | Line 36: | ||
sizeof(myarray) % get number of elements | sizeof(myarray) % get number of elements | ||
sizeof(myarray(1)) %get length of first string | sizeof(myarray(1)) %get length of first string | ||
+ | |||
+ | % Iterate strings in string array | ||
+ | for str = myarray | ||
+ | disp(str) | ||
+ | end | ||
+ | |||
</ | </ | ||
Note: Arrays are 1-based, not 0-based as they usually are in real programming languages. | Note: Arrays are 1-based, not 0-based as they usually are in real programming languages. |
octave/octave.txt · Last modified: 2009/04/23 13:54 by deva