Octave's equivalent to Matlab's which('filename', '-all') - matlab

In Matlab, which('filename', '-all') returns all the files with the given 'filename' in the Matlab path, but Octave only returns the first one (not the shadowed ones). Is there an easy way get the equivalent in Octave?

this is a longstanding feature request for Octave that as of this post has not yet been resolved. See Bug #32973 and Bug #32088. The latter link appears to have a workaround patch and function attached that never quite made it into the main codebase.
UPDATE 16 Nov 22: while the bug has not been fixed, rather than silently fail Octave v8 will now provide a warning to the user that the option is not yet implemented and only the first result will be returned.

Related

How to see the Matlab code behind a Matlab function

There is a function in Matlab called copulafit. How can I see the code that underlies this function? Many numpy and scipy functions for Python are readily open source on Github, but I can't find Matlab functions on Github for some reason
If you have MATLAB installed you can either highlight the function name then secondary/right-click and select Open "copulafit" or alternatively type open copulafit in the command window. Yeah, I believe MATLAB isn't open source as of this posting time/date. Possibly why the reason for the lack of GitHub resources. Octave might be something that might be interesting to look into.

Elusive MATLAB built-in function

I am trying to read the following internal MATLAB function:
>>which visionInitializeAndExpandCheckerboard
built-in (C:\Program Files\MATLAB\R2015a\toolbox\vision\vision\visionInitializeAndExpandCheckerboard)
But it appears to be hidden away! And very well hidden.
None of the following methods to access it have worked:
Highlighting the name and pressing Ctrl+D.
Typing "edit visionInitializeAndExpandCheckerboard" in the command line.
Searching for the file in Matlab's own FindFiles.
Searching for the file on the disk.
Trying to Step Into the function in debug mode (I just get the output as if I had requested Step Out instead).
Btw, the reason I am looking into this is that the parent function detectCheckerboardPoints has seriously declined in performance from R2015a to R2016b and I am trying to figure out why.
The internal function is compiled native code, so you will not be able to see its source. If you see a performance degradation, you should call Mathworks tech support and complain. If it is something they can fix, they will send you a patch, and fix it in the next release.

Octave set break point in a class function

How do I set a break point in an Octave class function when the class is implemented in a single m file?
Octave documentation https://www.gnu.org/software/octave/doc/interpreter/Breakpoints.html
briefly mentions:
Breakpoints in class methods are also supported (e.g., dbstop ("#class/method")).
However, my classdef file is a single m file directly sitting in my work dir. How do I set a break point in this case? I tried to do it in Octave 4.0.0 GUI, and in command window, use dbstop with various arguments I can imagine. But none worked. In Matlab, it is as simple as a click in the GUI editor.
Short answer: it does not work.
You are right, this should be possible, but it does not work due to a bug in Octave. The bug is already reported as #45404 on the Octave bug tracker.

Residuals from ARMA estimation in MATLAB

I am trying to use the function armaxfilter from the MFE toolbox, but I get an error:
>> parameters = armaxfilter(y,1,1,1);
??? Error: File: armaxfilter.m Line: 477 Column: 21
Expression or statement is incorrect--possibly unbalanced (, {, or [.
Apparently my code is correct, as can be seen from an example from help:
EXAMPLE:
To fit a standard ARMA(1,1), use
parameters = armaxfilter(y,1,1,1)
Any idea on what is wrong?
In any case, my aim is getting residuals from an ARMA model estimation on a time series, a suggestion on an alternative way would be helpful as well.
Looking at the code (from here) , the issue is probably with the tilde output. If you are using an old version of MATLAB which does not support ~, you may get the error you mention.
There is a simple way to check this. Try out at the command line:
[~,idx] = min(1:10)
If this causes an error, you are using a version of MATLAB which does not support ~. If you want to use that particular code, you will have to either upgrade your MATLAB, or edit all the files such that examples of the tilde are replaced with some sort of dummy variable, e.g.:
[garbage,idx] = min(1:10)
As the error message describes, the problem lies in the armaxfilter.m. You should open that file and see what code is written at the specified line. I am sure you will see a bug in there.

Two bag-of-words classifiers, Matlab

I'm trying to implement "Two bag-of-words classifiers", so I found resources at this website. http://people.csail.mit.edu/fergus/iccv2005/bagwords.html This website provides complete files including Matlab code. But I've encountered some errors while implementing the code.
I run this code on Matlab 2011b , under Windows 7.
At first, some errors occur because of path experession, but this can be soleved. At file "gg_lola_km_binary.m", replace "/" with "\" due to path expression in Windows, and it also needs to allocate appropiate path. After doing this, this error has been solved, but the next error occur:
Error using imformats>find_in_registry (line 512)
Format specifier must be a 1-D character array.
I consider whether this error results from Matlab version difference, but I don't know how to solve this problem.
Thank You
The error should be something to do with the format of your Input.Not your Matlab version. Most of the written distributed functions are constructed using basic operations and should work on most versions of Matlab (even the older versions); if not it will probably prompt an unknown function being called which it does not recognize.
Your errors seems to say that:
The function imformats>find_in_registry is looking for a 1 dimensional character array, which it did not find. (most possibly in your input file format or file path). I suggest you check again, without further information, we cannot help you.