Editing Using Octave
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 114: | Line 114: | ||
= Control flow | = Control flow wih loops = | ||
Octave supports <code>for</code> and <code>while</code> loops, as well as other control flow | Octave supports <code>for</code> and <code>while</code> loops, as well as other control flow | ||
Line 128: | Line 128: | ||
k = 1; | k = 1; | ||
step = 2; | step = 2; | ||
while (k <= 100) | while (k <= (100-step)) | ||
y( | y(i) = k^2; | ||
k = k + step; | k = k + step; | ||
endwhile</syntaxhighlight> | endwhile</syntaxhighlight> | ||
= Vectorization = | = Vectorization = | ||
Line 161: | Line 163: | ||
ylabel ('w');</syntaxhighlight> | ylabel ('w');</syntaxhighlight> | ||
[[File:Using octave-1.png | [[File:Using octave-1.png]] | ||
= Strings = | = Strings = |