Latex Text in Axis/Title Octave - matlab

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.

Related

How do you use the LaTeX blackboard font in MATLAB? (2019)

My question is: How can I use Latex mathbb fonts in Matlab.
Furthermore, I have no rights to change Matlab files on my PC.
I do not want to use psfrag, suggested sometimes as a solution, since some of my figures generated with Matlab are pictures and they get really big if they are exported to eps.
I am using Matlab 2017a.
Note:
This is a follow up question to How do you use the LaTeX blackboard font in MATLAB?.
The answer to this question seems outdated. My
MATLAB root\toolbox\matlab\graphics file contains no matlab commands anymore; it seems to be a precompiled file now.
Thus the approach from the original does not work.

Line number of matlab does not show

I am using Matlab 2016a version.
I go the preference--->Editor/Debugger--->Display--->General display options--->Show line numbers, checked. Then I reboot the matlab, however, in the text editor, there is still no line numbers.
Does anyone encounter same problem before?

I want to run code of a older version of matlab in latest version of matlab?

Hi I'm in a great trouble
I have a wavelet transform code for image processing in a an older version of matlab which uses older functions, not supported in new matlab version i.e mmread() etc. is there any tool or anything which can help me converting or running this code??? thank you very much
When there's a rare incompatible change in furnctions in Matlab, the solution is to modify the code to use the new functions. If you want to ensure that your code will still run on the old versions of Matlab as well, then you can use verlessthan:
if verLessThan('matlab', '7.0.1')
% -- Put code to run under MATLAB 7.0.0 and earlier here --
else
% -- Put code to run under MATLAB 7.0.1 and later here --
end
If you have a license for MATLAB that is in maintenance, you can download previous versions of MATLAB from MathWorks website.

How can I get a list of all the defined variables in Matlab or Octave?

I'm used to working in Matlab using its full GUI environment. Due to license issues I went and installed Octave, but it appears that it doesn't have a GUI, at least not one that's installed by default.
I transferred the variables from Matlab to Octave by saveing them in Matlab and loading them in Octave. Thing is, I don't remember the names because I got used to seeing them in the little workspace window which I no longer have.
How can I see the list of defined variables and their types in Octave?
The command whos will do just that.
With the command whos you can even see the variables that the file has WITHOUT opening the file, to be assure that this file is the one.
For example, the name of the file is MyVariables.mat
use:
whos('-file','MyVariables.mat')
You can use a GUI similar to Matlab, such as QtOctave or GUIOctave.

running old mex file on new matlab releases

I'm trying to run a program originally tested on Matlab 6.5 on a new release (R2009a)
The program uses some mex files, and I get the following error when trying to run it:
??? Invalid MEX-file '/normalizedCut/common_files/sparsifyc.mexglx':
normalizedCut/common_files/sparsifyc.mexglx: symbol mxGetIr, version
libmx.INTERNAL not defined in file libmx.so with link time reference.
(the code I'm trying to tun is Normalized cut by Shi & Malic, and can be found here:
http://www.cis.upenn.edu/~jshi/software/files/NcutClustering_7.zip)
If I try to run the code on the same system but Matlab 2007a it runs ok.
Is there some problem with backwards compatibility for 2009a?
Are there any flags somewhere in the system I can change to help it work?
When I googled it I saw some references to the LD_LIBRARY_PATH env variable, but what exactly should be added to it I could not find out.
Thanks,
Yair
The source code for those mex functions appears to be available in the "Image segmentation with normalized cuts" source on this page: http://www.cis.upenn.edu/~jshi/software/ (in the specific_NcutImage_files subdirectory in the unpacked .zip)
It's pretty common for there to be problems running mex functions with different versions of Matlab. The errors you're getting look like they're due to API changes in Matlab (though that surprises me a little). I've had the most trouble because of binary incompatibilities induced by changes in gcc. I'd suggest contacting Jiambo and asking him if he can build a new version or release the source.
Worst case, you could try re-implementing those mex functions. The normalized cut algorithm is pretty straightforward in Matlab (see the Shi and Malik paper). By the names of the mex functions, they look like they're mostly duplicating existing matlab functionality (matrix multiplication, matrix sparsification). There's a non-zero chance that if you re-implemented them as regular m-code functions they'd be faster anyway due to the multicore support that's been added to Matlab.