Difference between revisions of "Octave"
From Coder Merlin
(Created page with "== Graphing == * Be sure to execute <code>graphics_toolkit("gnuplot")</code> prior to graphing") |
|||
Line 1: | Line 1: | ||
== Graphing == | == Graphing == | ||
* Be sure to execute <code>graphics_toolkit("gnuplot")</code> prior to graphing | * Be sure to execute <code>graphics_toolkit("gnuplot")</code> prior to graphing | ||
== Examples == | |||
=== 3-D Sombrero Plot === | |||
<syntaxhighlight lang="matlab"> | |||
tx = ty = linspace (-8, 8, 41)'; | |||
[xx, yy] = meshgrid (tx, ty); | |||
r = sqrt (xx .^ 2 + yy .^ 2) + eps; | |||
tz = sin (r) ./ r; | |||
mesh (tx, ty, tz); | |||
xlabel ("tx"); | |||
ylabel ("ty"); | |||
zlabel ("tz"); | |||
title ("3-D Sombrero plot"); | |||
</syntaxhighlight> |
Revision as of 20:11, 14 October 2020
Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder
Graphing[edit]
- Be sure to execute
graphics_toolkit("gnuplot")
prior to graphing
Examples[edit]
3-D Sombrero Plot[edit]
tx = ty = linspace (-8, 8, 41)';
[xx, yy] = meshgrid (tx, ty);
r = sqrt (xx .^ 2 + yy .^ 2) + eps;
tz = sin (r) ./ r;
mesh (tx, ty, tz);
xlabel ("tx");
ylabel ("ty");
zlabel ("tz");
title ("3-D Sombrero plot");