Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Undocumented Matlab

Subject: Undocumented Matlab

From: Yair Altman

Date: 27 Mar, 2009 11:42:01

Message: 1 of 9

Dear fellow Matlab users,

Over the past few years I became very interested in the topic of the undocumented, under-documented, mis-documented and semi-documented aspects of Matlab. Users of this forum probably know I'm a frequent poster here of undocumented solutions to everyday problems. It has been a real pleasure to discover the enormous number of hidden goodies that Matlab has available, if we only knew where to look for them. This includes hidden features, properties, functions, interfaces and even aspects of some well-known Matlab stock functions.

For this reason, a few days ago I have started a new blog, http://Undocumented-Matlab.com (http://UndocumentedMatlab.com also works) which is dedicated to this issue. I plan to post a variety of my findings, ranging from harmless beginner-level things (like undocumented features, documentation mistakes or uicontrol's support of HTML) to expert-level don't-do-this-at-home stuff (like modifying desktop properties or calling Matlab from Java using JMI).

A list of some of my upcoming posts can be found here: http://UndocumentedMatlab.com/todo/ - please feel free to ask for more items, or to let me know your preference of which topic to post sooner.

I hope this new blog will be interesting to you, and I look forward to hearing any feedback you may have.

Best regards,
Yair Altman
http://UndocumentedMatlab.com
 

Subject: Undocumented Matlab

From: Matt Fig

Date: 27 Mar, 2009 14:59:02

Message: 2 of 9

Cool! I look forward to reading what you have discovered. Thanks.

Subject: Undocumented Matlab

From: James Tursa

Date: 27 Mar, 2009 15:10:17

Message: 3 of 9

"Yair Altman" <altmanyDEL@gmailDEL.comDEL> wrote in message <gqie29$5ad$1@fred.mathworks.com>...
>
> .. please feel free to ask for more items ...

Any chance of putting some mex stuff in there? Like the undocumented functions mxCreateReference and mxUnshareArray? Also, I have never been able to figure out how to make a lazy copy of an mxArray inside a mex routine. I'd sure like to find out how to do this if it is possible.

James Tursa

Subject: Undocumented Matlab

From: Matt

Date: 27 Mar, 2009 15:32:02

Message: 4 of 9

One of my favorite undocumented things that people on this board tipped me off to is that strfind() works with numeric data as well, e.g.

>> strfind([1 1 1 1 3 3 3 2 2],[3 2])

ans =

     7


This is very useful for finding the beginning and end of blocks of consecutively identical numbers. It's obviously a common task because you often see people on this board soliciting help with these kinds of problems...

Subject: Undocumented Matlab

From: Yair Altman

Date: 27 Mar, 2009 15:33:13

Message: 5 of 9

"James Tursa" <aclassyguywithaknotac@hotmail.com> wrote in message <gqiq8p$i2c$1@fred.mathworks.com>...
> "Yair Altman" <altmanyDEL@gmailDEL.comDEL> wrote in message <gqie29$5ad$1@fred.mathworks.com>...
> >
> > .. please feel free to ask for more items ...
>
> Any chance of putting some mex stuff in there? Like the undocumented functions mxCreateReference and mxUnshareArray? Also, I have never been able to figure out how to make a lazy copy of an mxArray inside a mex routine. I'd sure like to find out how to do this if it is possible.
>
> James Tursa

You got it :-)

Several other undocumented mex functions were reported over the years beside these two: ioGetNumWindowRows/ioGetNumWindowColumns (R12), mxIsSharedArray, mxDestroyArray, mxSetInterruptEnabled, mxserialize/mxdeserialize, mxSubs*, utIsInterruptPending. Perhaps some of these became documented lately - I haven't followed Mex closely so if someone knowledgeable can bring me up to date I'd be grateful.

Yair Altman
http://UndocumentedMatlab.com
 

Subject: Undocumented Matlab

From: James Tursa

Date: 27 Mar, 2009 18:37:01

Message: 6 of 9

"Yair Altman" <altmanyDEL@gmailDEL.comDEL> wrote in message <gqirjp$khs$1@fred.mathworks.com>...
> "James Tursa" <aclassyguywithaknotac@hotmail.com> wrote in message <gqiq8p$i2c$1@fred.mathworks.com>...
> > "Yair Altman" <altmanyDEL@gmailDEL.comDEL> wrote in message <gqie29$5ad$1@fred.mathworks.com>...
> > >
> > > .. please feel free to ask for more items ...
> >
> > Any chance of putting some mex stuff in there? Like the undocumented functions mxCreateReference and mxUnshareArray? Also, I have never been able to figure out how to make a lazy copy of an mxArray inside a mex routine. I'd sure like to find out how to do this if it is possible.
> >
> > James Tursa
>
> You got it :-)
>
> Several other undocumented mex functions were reported over the years beside these two: ioGetNumWindowRows/ioGetNumWindowColumns (R12), mxIsSharedArray, mxDestroyArray, mxSetInterruptEnabled, mxserialize/mxdeserialize, mxSubs*, utIsInterruptPending. Perhaps some of these became documented lately - I haven't followed Mex closely so if someone knowledgeable can bring me up to date I'd be grateful.
>
> Yair Altman
> http://UndocumentedMatlab.com
>

Great! mxDestroyArray is an official documented function, but I don't think any of the others are. You might add mxDestroyArrayContents to the list ... I have seen that in seg fault traceback lists (I would assume the name pretty much says it all as far as the function behavior is concerned).

James Tursa

Subject: Undocumented Matlab

From: Loren Shure

Date: 27 Mar, 2009 18:53:36

Message: 7 of 9

In article <gqirhi$g1o$1@fred.mathworks.com>, xys@whatever.com says...
> One of my favorite undocumented things that people on this board tipped me off to is that strfind() works with numeric data as well, e.g.
>
> >> strfind([1 1 1 1 3 3 3 2 2],[3 2])
>
> ans =
>
> 7
>
>
> This is very useful for finding the beginning and end of blocks of consecutively identical numbers. It's obviously a common task because you often see people on this board soliciting help with these kinds of problems...
>

Mentioned last Sept. ago here:
http://blogs.mathworks.com/loren/2008/09/08/finding-patterns-in-arrays/

--
Loren
http://blogs.mathworks.com/loren

Subject: Undocumented Matlab

From: Matt

Date: 27 Mar, 2009 18:57:01

Message: 8 of 9

Loren Shure <loren@mathworks.com> wrote in message <MPG.2436eabaa45d3b98989964@news.mathworks.com>...
> In article <gqirhi$g1o$1@fred.mathworks.com>, xys@whatever.com says...
> > One of my favorite undocumented things that people on this board tipped me off to is that strfind() works with numeric data as well, e.g.
> >
> > >> strfind([1 1 1 1 3 3 3 2 2],[3 2])
> >
> > ans =
> >
> > 7
> >
> >
> > This is very useful for finding the beginning and end of blocks of consecutively identical numbers. It's obviously a common task because you often see people on this board soliciting help with these kinds of problems...
> >
>
> Mentioned last Sept. ago here:
> http://blogs.mathworks.com/loren/2008/09/08/finding-patterns-in-arrays/

That's great. Of course, it would be great if all these undocumented goodies one day become documented!

Subject: Undocumented Matlab

From: us

Date: 27 Mar, 2009 19:06:02

Message: 9 of 9

Loren Shure
> > One of my favorite undocumented things that people on this board tipped me off to is that strfind() works with numeric data as well, e.g.
> > This is very useful for finding the beginning and end of blocks of consecutively identical numbers. It's obviously a common task because you often see people on this board soliciting help with these kinds of problems...

> Mentioned last Sept. ago here:
> http://blogs.mathworks.com/loren/2008/09/08/finding-patterns-in-arrays/

hmmm... for once i may have been the first...

see in this reply on march 13, 2002, which clearly states
...i just wanted to alert NGers to the STRFIND stuff because ...

http://groups.google.com/group/comp.soft-sys.matlab/msg/7302c2a775f656f4

just a thought...
us

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us