Language page — context, influences, and learning notes on the 100hellos site.
Source on GitHub (100hellos/octave)
docker run --rm --platform="linux/amd64" 100hellos/octave:latest
Read the repo README, or fork the project and customize it.
For an interactive shell:
docker run --rm --platform="linux/amd64" --entrypoint="" -it 100hellos/octave:latest zsh
GNU Octave is a high-level programming language primarily intended for scientific computing and numerical analysis. It is largely compatible with MATLAB, making it an excellent free and open-source alternative for mathematical computations.
Octave was originally conceived in 1988 by John W. Eaton as a companion to a graduate-level textbook on chemical reactor design. The name "Octave" is a reference to Octave Levenspiel, a professor of chemical engineering who inspired the project. The language has evolved far beyond its original chemical engineering roots to become a powerful tool for:
Octave aims for compatibility with MATLAB, meaning most MATLAB scripts will run unchanged in Octave. This makes it an excellent choice for:
Like MATLAB, Octave treats matrices as fundamental data types:
# Create a 3x3 matrix
A = [1, 2, 3; 4, 5, 6; 7, 8, 9]
# Matrix multiplication
B = A * A
# Element-wise operations
C = A .* A # Note the dot notation
Octave includes thousands of built-in functions for mathematical operations:
# Trigonometric functions
sin(pi/2)
# Linear algebra
eig([1, 2; 3, 4]) # Eigenvalues
# Statistics
mean([1, 2, 3, 4, 5])
Our implementation is elegantly simple:
#!/usr/bin/env octave
printf("Hello World!\n");
#!/usr/bin/env octave allows the script to be executed directlyfprintf, Octave's printf is modeled after C's printf\n ensures proper line terminationThis simple "Hello World!" demonstrates several important aspects of Octave:
| Feature | Octave | MATLAB |
|---|---|---|
| Cost | Free | Commercial license required |
| Source | Open source | Proprietary |
| Syntax | 95%+ compatible | Reference implementation |
| Toolboxes | Limited | Extensive commercial toolboxes |
| Performance | Good | Optimized for specific workflows |
After running this container, you might want to explore:
Octave's development has been remarkably stable and consistent. The project has maintained backward compatibility while continuously adding features, making it one of the most reliable scientific computing platforms available. Its commitment to MATLAB compatibility has made it a bridge between proprietary and open-source scientific computing.
Content type
Image
Digest
sha256:d7451e78a…
Size
181.8 MB
Last updated
4 months ago
docker pull 100hellos/octave