Kernel: Octave
Octave 7.1.0 on CoCalc
https://www.gnu.org/software/octave/news/release/2020/01/31/octave-5.2.0-released.html
In [1]:
warning: using the gnuplot graphics toolkit is discouraged
The gnuplot graphics toolkit is not actively maintained and has a number
of limitations that are unlikely to be fixed. Communication with gnuplot
uses a one-directional pipe and limited information is passed back to the
Octave interpreter so most changes made interactively in the plot window
will not be reflected in the graphics properties managed by Octave. For
example, if the plot window is closed with a mouse click, Octave will not
be notified and will not update its internal list of open figure windows.
The qt toolkit is recommended instead.
ans = 7.1.0
In [2]:
ans =
8 6 -2
12 9 -3
16 12 -4
In [3]:
x =
1.3095 0.6240 1.7322
0.2901 0.1474 0.3930
1.2244 0.5536 1.6003
In [4]:
In [5]:
In [6]:
In [7]:
In [8]:
In [9]:
error: package dicom is not installed
error: called from
load_packages at line 47 column 7
pkg at line 623 column 7
In [10]:
error: 'dicomuid' undefined near line 1, column 1
The 'dicomuid' function belongs to the dicom package from Octave Forge
which seems to not be installed in your system.
Please read <https://www.octave.org/missing.html> to learn how you can
contribute missing functionality.
In [13]:
In [14]:
ans = 46.021
This plot shows the famous 3D sombrero.
A quadratic meshgrid of and coordinates is evaluated via and the value is then the value plotted along the third dimension.
Reference: 3d plots
In [15]:
In [16]:
In [0]:
This draws the set of points, where the given equation is satisfied. Here, it shows a tilted ellipse.
Reference: ezplot
In [17]:
Imagine you want to evaluate a binary function .
For evaluating it in vectorized notation, you need a grid for the cartesian product of all and .
In [18]:
ans =
0 1 2 3
2 3 4 5
4 5 6 7
6 7 8 9
8 9 10 11
dsolve and sympy in symbolic
In [19]:
/usr/local/lib/python3.8/dist-packages/sympy/__init__.py:672: SymPyDeprecationWarning:
importing sympy.core.compatibility with 'from sympy import *' has been
deprecated since SymPy 1.6. Use import sympy.core.compatibility
instead. See https://github.com/sympy/sympy/issues/18245 for more
info.
self.Warn(
Traceback (most recent call last):
File "<stdin>", line 4, in <module>
File "<stdin>", line 12, in octoutput_drv
File "<stdin>", line 55, in octoutput
File "/usr/local/lib/python3.8/dist-packages/sympy/__init__.py", line 677, in __getattr__
return getattr(self.mod, name)
AttributeError: module 'sympy.core.compatibility' has no attribute 'integer_types'
error: Python exception: AttributeError: module 'sympy.core.compatibility' has no attribute 'integer_types'
occurred while copying variables to Python.
Try "sympref reset" and repeat your command?
(consider filing an issue at https://github.com/cbm755/octsympy/issues)
error: called from
pycall_sympy__ at line 191 column 5
valid_sym_assumptions at line 38 column 10
assumptions at line 82 column 7
syms at line 97 column 13
error: 'dsolve' undefined near line 1, column 5
'dsolve' is a method of class 'sym'; it must be called with a 'sym'
argument (see 'help @sym/dsolve').
Please read <https://www.octave.org/missing.html> to learn how you can
contribute missing functionality.
Octave's ODE PKG in Action
In [20]:
error: package odepkg is not installed
error: called from
load_packages at line 47 column 7
pkg at line 623 column 7
In [21]:
In [0]:
In [0]:
You can run numerical optimizations via the optim package.
In this example we minimize the classical Rosenbrock function in 20 dimensions using BFGS.
In [22]:
Picked up _JAVA_OPTIONS: -Djava.io.tmpdir=/home/user/tmp -Xms64m
warning: __bfgsmin_obj: objective function could not be evaluated - setting to DBL_MAX
warning: called from
bfgsmin at line 129 column 39
error: objective: function called with too many inputs
error: called from
objective
bfgsmin at line 129 column 39
In [0]: