VC6 fopen mode parameter - fopen

I am trying to understand some legacy VC6 code, and see a call to fopen using a mode parameter of "ra". What mode is this?

By trial and error, I think it is the equivalent of "a+"

Related

Turning off warnings in Octave

I am running a Matlab compatible script in Octave, so I was awaiting few warnings concerning the '&' and '|' commands and others, so I added the "warning('all','off')" in my now Octave script, but it doesn't seem to do anything... I don't get it, I still get the same warnings!
Any ideas how to solve this please?
PS: I am running the Octave script in batch mode.
It should be warning('off','all') or just warning('off'), your arguments are inverted.
Docs: https://octave.sourceforge.io/octave/function/warning.html
warning ("off", id)
If the first argument is "on" or "off", set the state of a particular warning using the identifier id. If the first argument is "query", query the state of this warning instead. If the identifier is omitted, a value of "all" is assumed.
Obligatory note that it's probably a better idea to address the warnings than turn them off, and that you should at least re-enable the warnings after specific functions where you want to ignore them.

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.

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.

How to change the MATLAB path back to the default?

I was trying to add a toolbox in MATLAB and instead of calling addpath('path'), I called path('path').
Now I'm getting a lot of errors, like
if I initialize a variable, I get
Error using eval. Undefined function 'workspacefunc' for input arguments of type struct
Is there anyway I can restore the default MATLAB path/paths ?
Use the MATLAB command
restoredefaultpath
to restore the MATLAB search path to the state at startup.
See MATLAB documentation for restoredefaultpath here
I had a similar situation where on startup, on Windows 8.1 64-bit, Matlab R2014b would show the same error and then no function would work.
In my case, restoredefaultpathcouldn't be found.
Setting the UserPath in the matlab setting file as suggested elsewhere also didn't help.
The solution was to remove the environment variable MATLABPATH that I had set as a convenience while trying to compile against Matlab libraries.
The error message could be more helpful...

How to access inbuilt functions?

As what should I be typing in the Command Window to get the function file to open?
Usually I get a link to them when debugging and an error occurs, but what command can be used to access them directly?
edit functionName, e.g. edit repmat.
There are built-in functions that are not written in Matlab, but for these functions you cannot take a look at the code even if an error occurs.