Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use octave in vscode?

How can I create and debug octave programs in Visual Studio Code? Please provide details regarding Path settings etc.

I'm taking Andrew Ng's course on Machine learning in which he suggests octave as the language for beginners, will octave be useful later on for purposes other than purely academic learning? Can I create machine learning algorithms using octave?

like image 531
Karmah24 Avatar asked May 22 '20 17:05

Karmah24


People also ask

How do I run octave code in VS Code?

Open the directory containing the project that you want to debug using everyone's favorite editor, visual studio code. In the vsCode debug view click the DEBUG drop-down box and select "Add configuration..." . See animation above. Select "OctaveDebugger" from the menu that pops up.

Can we use octave in VS Code?

Yes of course, it's fully configurable like you'd expect from an IDE. @TasosPapastylianou - Octave GUI does not have a dark mode. It only allows you to change a small portion of the background color.

What does F12 do in VS Code?

If a language supports it, you can go to the definition of a symbol by pressing F12. Tip: You can jump to the definition with Ctrl+Click or open the definition to the side with Ctrl+Alt+Click.


3 Answers

Press Cmd+Shift+P (or Ctrl+Shift+P) and search for "Preferences: Open Settings (JSON)". Then add the following entry to the settings file:

"terminal.integrated.env.windows": {
    "PATH": "C:\\Octave\\Octave-5.2.0\\mingw64\\bin"
  }

Then you'll be able to type "octave" in the terminal to access the octave shell

Note: "C:\Octave\Octave-5.2.0\mingw64\bin" is the path where octave is installed for me

like image 67
Mohammad Saqib Shah Avatar answered Jan 04 '23 16:01

Mohammad Saqib Shah


Under settings add this to the terminal shell settings in vscode

"terminal.integrated.shell.windows": "C:\\Octave\\Octave-5.2.0\\mingw64\\bin\\octave-gui.exe"

This is the default installation location . Add the location where you have installed octave.

like image 44
Karmah24 Avatar answered Jan 04 '23 15:01

Karmah24


VS Code has plugins for working with Octave, available on the VS Code Marketplace.

For running and debugging Octave code inside VS Code, try the Octave Debugger plugin.

For syntax highlighting and file structure recognition, try the Octave plugin from Toasty Technologies or (shameless plug) my own Octave Hacking plugin.

like image 22
Andrew Janke Avatar answered Jan 04 '23 16:01

Andrew Janke