MATLAB profiler. DetailLevel: mmex? - matlab

In the MATLAB documentation I see the following :
My question is: What is DetailLevel for ? What does the default value mmex mean? I couldn't find an explanation of these keywords on the official documentation.

It's for an old feature of the profiler, which is now undocumented. The DetailLevel property controls which functions are profiled; if it is 'mmex' then M-functions, subfunctions and MEX-functions will be profiled, while if it is 'builtin', builtins will be profiled as well.
There used to be a third level, 'operator', which would even profile things like +.

Related

Sort diagrams alphabetically in Doxygen using doxyfile configuration

I'll draft my question as per the suggestion provided by StackOverflow
1. Problem summary
While generating documentation using doxygen (Environment Ubuntu 20.04), I can observe the sequence diagrams (as a subpage) are not listed in numerical order (i.e. improperly sorted).
Image:
2. What I've tried
In the doxyfile that I use, I set YES to the flags listed below.
SORT_BRIEF_DOCS
SORT_BY_SCOPE_NAME
SORT_GROUP_NAMES
SORT_MEMBERS_CTORS_1ST
SORT_MEMBER_DOCS
Now, you might wonder why I did that. Since I am new to generating documentation with doxygen, and the flag name "SORT" caught my attention, I tried to set these flags to YES. However, the end result was not what I expected. It is evident that I am doing something that is incorrect, and it would be great if someone could point me towards the proper direction.

where do I find reference for linalg.get_lapack_funcs('geqrf')

I looked up on scipy manual,
https://docs.scipy.org/doc/scipy/reference/genindex.html#G
but don't see this 'gearf' function anywhere.
Does any one recognize it and can provide documentation for it?
Perhaps it is not just geqrf but dgeqrf or sgeqrf or cgeqrf or zgeqrf?
Look at the Scipy examples here to see how they use get_lapack_funcs() without specifying the type.
If you want to access directly to the LAPACK routine then it is accesible via
scipy.linalg.lapack.sgeqtrf
scipy.linalg.lapack.dgeqtrf
scipy.linalg.lapack.cgeqtrf
scipy.linalg.lapack.zgeqtrf
or you can use what Antimony suggested.
But this is already wrapped via scipy.linalg.qr. If you set pivoting to True, ?geqr3 is used and otherwise ?geqrf is used in the background.

Automatic documentation of an OO MATLAB project with mtoc++/Doxygen

I have an OO project in MATLAB and would like to automatically produce some documentation.
After some research I have found a convenient tool called mtoc++ which apparently produces a documentation using Doxygen (I have no experience with).
My only question is whether in order to use the tool I need to write comments in MATLAB using a specific format (language?) so that mtoc++/Doxygen could understand and document my comments?
If so, then what this format/ language is and where I can find its description?
After correctly installing and configuring mtoc++/Doxygen, the documentation is created automatically.
If you want to define personalized comments for specific custom parameters, you can follow the instructions on this page:
http://www.ians.uni-stuttgart.de/MoRePaS/software/mtocpp/docs/tools.html
Look under the heading Configuration options for the mtoc++ filter.
What you have to do is to edit the mtocpp.conf file, located in tools/config folder, and the format you'll be using is this:
add(params) = <parameter1_name> => """Your parameter1 description text in triple quotes""";
An example would be:
add(params) = myVariable => """This variable is defined by me""";
So you can define personalized comments for your Parameters, Fields, Extra Documentation and Global Settings.
I am sure there must be other workarounds to add comments and documentation.
I hope this helps. Happy coding.

Using abbreviations for parameter-value input pairs - why does cellfun's `'UniformOutput', false` work as `'un', 0`?

As a frequent user of cellfun(..., 'UniformOutput', false), I was surprised to discover that the latter two arguments could be input as cellfun(..., 'un', 0). This has immediately shortened my code. My question is, are there any another similar shortcuts/aliases out there?
This doesn't appear to be documented on the MathWorks website. Naughty!
Background
The property part of a Property-value pair can be often be shortened to the beginning of the property string so long as it is still uniquely identifiable (see examples below). They are also often not case sensitive.
As far as I know this is not documented for anything other than figure properties, where it is very briefly documented.
However this behaviour is also implemented in many The MathWorks functions which take property-value pair arguments, and also in some functions which take string arguments with no value pair.
The problems become what other properties are there...
For some functions is not well documented... (and many are either
built-in or obfuscated .p files, so no checking the source).
Most importantly we cannot know if future versions will introduce new
properties.
The use of shortened property names is advised against for this reason, to quote
"using the full property name can prevent problems with futures releases of MATLAB if a shortened name is no longer unique because of the addition of new properties." - Matlab documentation
"Don't shorten your code with P-V abbreviations, it's not worth it, trust me." – Sam Roberts
The brief slightly technical side - This functionality is implemented by default by Matlabs inputParser, however it can be disabled so these abbreviations are by no means guaranteed to work on every function. Only those which use the inputParser in this way or are specifically written to allow this.
Examples using figure properties
Simple Shortening
The following
hFig = figure();
get(Hfig,'Visible')
ans =
on
can be shortened to
hFig = figure();
get(Hfig,'v')
ans =
on
as it is the only property beginning with 'v' (note that 'vi','vis', etc... also work)
Uniqueness
However other properties which start similarly e.g. CurrentAxes, CurrentCharacter & CurrentObject
get(Hfig,'Current')
Error using get
Ambiguous property found.
Object Name: figure
Property Name: 'Current'.
Where as 'currenta','currentc' and 'currento' are uniquely identifiable and would work as intended
Impossible to shorten
A special mention to properties such as Color and ColorMap the name of one is the beginning of another
Color can only be used with its full name, due to any shortening being ambiguous with ColorMap
'ColorMap' can be shorted to 'colorm' however, as before.
Counter examples
This section aims to discourage use of shortened property value pairs by showing some of the seemingly unpredictable and unexpected behaviour.
The semi-undocumented hardcopy has some interesting behaviour the documentation states possible options as -dps,-deps,-dps2,-deps2,-dill,-dhpgl
However '-dh' creates an error where as '-di' works as an abbreviated '-dill' sadly there is no checking the source to see why as it is a .p file
Finally cellfun itself doesn't exactly follow there rules as 'u' should theoretically work if following the rules above, however only 'un' and onwards does.
If a routine uses MATLAB's inputParser functionality then usually any parameter name can be shortened such that it is still unambiguous and is matched case insensitively. The same is true for properties of objects such as get(gcf, 'pos') as a shorter version of get(gcf, 'Position').
However, I don't know if there is any documentation on this usage and I suggest you try it and see.
And 0 is usually equivalent to false (non-zero being true).
PS I would suggest that using these shortcuts is fine at the command line but when writing functions and scripts it is better to use the full names.

How can I check since which Matlab version a function exists?

It was impossible in 2007, but is there now a way to check which Matlab versions a function exists for?
For example, in Wolfram Mathematica, the documentation indicates in which version the function was released: e.g. the GapPenalty() documentation mentions "New in 7".
Have a look to the FEX function when.
I'd go to the release-notes page for some useful information.
For example.
http://www.mathworks.com/help/releases/R2013b/stats/release-notes.html
Then do a search in web page.
Hope this helps.