jupyter notebook with octave: code cell is plain text by default - matlab

I use jupyter notebook with octave kernel and it runs quite fine.
After a while I wondered why highlighting looks so strange.
Then I realized that part of the notebook is detected as python although an octave kernel is running.
Part of the code cells, in fact most are plain text.
Now I found out in the bottom left corner, one can choose.
The language for octave is in fact MATLAB.
This improves appearance very much.
But now I wonder whether I really must switch each cell individually.
I also found autodetect but this never finds MATLAB.

Related

X11 MATLAB Display Figure

I know it's possible to forward any output from a remote machine to a local one by using the X11 forwarding remote tunnelling, so that when you run a MATLAB command it will display all the graphical outputs back to the machine you've connected from.
My question is:
Is there any MATLAB command to just output the figures (e.g., plot,surf,etc.) without displaying any other graphical object (i.e., the main interface)?
In practice, I would like to interact with MATLAB by using the command line (as shown below) and forward back only the figures.
MATLAB cannot display figures without its own figure-GUI, so the answer to your question would be no.
However: there is a workaround: create an invisible figure using f=figure('visible', 'off'), then plot your data, and finally use saveas(f,filename,fileextention). Don't forget to close(f) your figure after saving, to free the RAM. You'll now have a figure in your file directory, which you can display using your favourite visualising tool, which might even be possible through a call to system, although I have never tested that.

Setup Sublime Text or alternative editor for Matlab?

I did not find any suitable answer or hint, so I am asking this here now: Is there any alternative editor for Matlab with a dark theme (easier to the eyes), that supports integration in Matlab for proper debugging, autocompletition etc.? And if so, how do I setup those editors on windows?
I am really annoyied of the default matlab text editor. The color theme can not be applied to the whole IDE and the syntax highlightning is really bad, because it can not distinguish between numbers, brackets, operation-symbols (=,+,- etc.) and more like that. It is sometimes really hard to read a matlab file in the default editor, because the lack of these basic features.
Thanks!
Looking back at my own question, I will try to give an answer. There is no way to define individual colors for matlab-code in matlab itself. Therefore I stick with Notepad or Atom, which have far superior color syntax even for matlab code. For running the code, you have to switch to matlab of course. This for sure no optimal solution, but the best to get better readability for matlab code.

Latex Text in Axis/Title Octave

I'm trying to run some of the Matlab code I have right now in Octave. (I know Octave doesn't support all Matlab code) In particular I am trying to run
xlabel('Frequency in $\pi$ units','Interpreter','LaTex')
However I get an error telling my Octave doesn't support the Latex interpreter. I found a workaround online but it is specific to Windows and I am running Linux Mint 14. I was wondering if anyone knew a workaround for Linux, using gnuplot I suppose (or anything else that gets the job done!).
This answer depends on your version of octave.
Set the label as you've done:
xlabel('Whatever')
ylabel('Whenever')
Then print your answer to a latex file:
print -dpslatex 'filename'
It is not perfect and the font size cannot be changed, but it is a solution.

Separate Matlab Editor Module?

Is it possible to have Matlab editor, without having the whole Matlab?
The warnings that Matlab editor provides are useful for me in coding, but I can not afford buying Matlab. How can I only use the editor? Does it still give warnings?
You could use GNU Emacs. Configure Emacs Octave Support. Then M files, within Emacs, will have syntax highlighting and indentation. You will not have in-editor warnings as in the MATLAB editor.
You could use Octave to run and test your M files. For simple scripts and functions, little to no modifications will be required to go from MATLAB to Octave, or vice versa. The same is not true for MATLAB code that implements GUIs or some of the more specialized toolbox.
You could certainly use a text editor to edit matlab files, as long as you save them with the .m extension. Unfortunately, as Matlab is the only program that can interpret the file, you won't get warnings as you work.
As an alternative, you could get FreeMat (http://freemat.sourceforge.net/) and work with .m files with proper syntax highlighting. However, FreeMat does not have the vast library of functions that Matlab has, and still won't provide you with warnings as you code.
Maybe you could work with Matlab in your institution's library (if you're a student), or get your business to pay for it (if you're a professional)?

matlab cell mode with vim/gvim

I want to run a cell using vim. however, using what I see here:
How to implement MATLAB-like cell mode in Vim
I get a matlab instance starting, running and then closing. Is it possible to to this like it would be on a real matlab? ie I have a vim on one side and matlab on the other (open all the time), and by a vim command I get the cell to run on the matlab?
Not sure whether this is exactly what you want, but you might want to browse through these answers