930A952D-B7CC-4A2D-ADB9-01342213D054-modified (Small).png

Kaleb Beebout

<aside> <img src="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/fddf2a37-7eb3-4a44-9b09-07e1393fb420/vzlb.png" alt="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/fddf2a37-7eb3-4a44-9b09-07e1393fb420/vzlb.png" width="40px" /> Mar. 3rd, 2022 | short read time | not many words

</aside>

I typically use Python for personal projects and have become quite fond of using Sublime Text as an super light IDE. During my engineering undergrad I developed the habit of using MATLAB as a ‘fancy calculator’ for anything beyond the realm of a napkin calculation. Unfortunately, a MATLAB license is a bit too expensive for such a use-case.

Enter GNU Octave. GNU General Public License, easy installation on Windows, Mac, and Linux, and generally cross-compatible with MATLAB and Simulink. Much has been written comparing Octave to basically any other programming language - I will defer to your research ability to assess. Link to GNU Octave.

Day-to-day I run Windows 11 on a Microsoft Surface Book. For my quick math needs I run a custom build file in Sublime Text. Here is an example of some random Octave code.

Untitled

Theme is Reverse Gravity and color scheme is Celeste - plenty of how-to’s on the world wide web to provision Sublime Text to your liking.

What I was not able to find is the build file to run Octave files natively on Windows. Here is the code snippet I use to enable Ctrl-B / Ctrl-Shift-B run:

{
    "cmd": ["C:/Program Files/GNU Octave/Octave-6.4.0/mingw64/bin/octave-cli.exe",
            "-p $file_path",
            "$file_name"],
    "path": "C:/Program Files/GNU Octave/Octave-6.4.0/mingw64/bin/octave-cli.exe",
    "selector": "source.matlab"
}

Depending on your choices of installation pathways you may need to modify the “cmd” and “path” lines with the target path where the “octave-cli.exe” program is installed.

This simple build file lets you harness the extreme power of GNU Octave as a simple quick calculator. Firepower superiority, or something...

How to set this up:

Read on if you are unfamiliar with custom build systems in Sublime Text. I shall try to explain in pictures. This assumes you have already installed Sublime Text and GNU Octave. Note your menu bar may look different depending on your theme, however the menu paths should be the same.

Step 1.

Go here and click new build system