Rank: 1168 based on 73 downloads (last 30 days) and 5 files submitted
photo

Hoi Wong

E-mail

Personal Profile:

http://www.stanford.edu/~wonghoi/

Professional Interests:
signal processing

 

Watch this Author's files

 

Files Posted by Hoi View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
30 Mar 2009 Map fields of a structure to output variables The program assigns each field of a structure into output arguments. Author: Hoi Wong dump, argument, variable, data structure, workspace, struct 12 2
26 Aug 2008 deltree Just like good old deltree.exe, but for MATLAB Author: Hoi Wong directories, file, path, deltree, utilities, files 5 0
20 Feb 2008 Screenshot Advanced hline and vline Draws horizontal/vertical lines in graphs. Accept axes handle and allows user to specify label posit Author: Hoi Wong horizontal line verti..., customization, graphics, plot, annotation 24 0
20 Feb 2008 Screenshot Nested Structure to Flat Cell Vector Tools to flatten a nested struct into cell Author: Hoi Wong nested struct flat ce..., structures, cell arrays 21 4
  • 3.66667
3.7 | 3 ratings
11 Feb 2008 Arbitrary files & MATLAB variables <-> data stream vector converter Encode any MATLAB data types into a numeric array, and vice versa Author: Hoi Wong external interface, file struct com data ... 11 0
Comments and Ratings by Hoi View all
Updated File Comments Rating
06 Apr 2009 statusbar set/get status bar(s) for GUI figures & Matlab desktop Author: Yair Altman

Great tool. My project uses a lot of your enableDisableFig and stausbar. But it seems like R2009b pops out a lot "Property name already in use" and MCR pops out a lot problems with 'undefined function or variable currentState' in enableDisableFig. Got some time to look at it? Thanks!

05 Apr 2009 UNIQUEWITHEQUALNANS Set unique, treating NaNs as equal (v2.0, mar 2009) Author: Jos (10584)

Great tool. But you cannot just pass [] into unique as second argument. I modified it for my own use, but I'd encourage the original author to update it instead of having me posting a minor modification of your work. :)

04 Apr 2009 dualcursor Add dual vertical cursors to a plot. Author: Scott Hirsch

It seems like the program doesn't like figures being a child of uipanel:

??? Error using ==> set
There is no 'WindowButtonDownFcn' property in the 'uipanel' class.

Error in ==> dualcursor at 688
        set(get(axh,'Parent'),'WindowButtonDownFcn','','WindowButtonUpFcn','')

Error in ==> dualcursor at 220
        dualcursor('off',[],[],[],axh);

Error in ==> episodesPanel>slider_strip_Callback at 147
dualcursor([1 2], handles.panel.episodes.infoDisplay.axes_electrogram);
 
??? Error while evaluating uicontrol Callback

??? Error using ==> uicontextmenu
An object of class uicontextmenu, can not be a child of class uipanel.

Error in ==> dualcursor at 325
        cmenu = uicontextmenu('Parent',get(axh,'Parent'));

Error in ==> episodesPanel>slider_strip_Callback at 147
dualcursor([1 2], handles.panel.episodes.infoDisplay.axes_electrogram);
 

04 Apr 2009 clickableLegend A legend with clickable strings that let you hide and show objects in a plot. Author: Ameya Deoras

Great idea! You saved my butt for my project.

03 Apr 2009 GRIDXY (v2.2 feb 2008) plot horizontal and vertical grid Author: Jos (10584)

Great Program. It'd be even better if it can accept an axes handle as its first input. For the moment, since I need it in a hurry, I tapped into your code and changed this:

function hh = gridxy(hca, x,varargin)

if(isempty(hca))
hca=get(get(0,'currentfigure'),'currentaxes')
end

Comments and Ratings on Hoi's Files View all
Updated File Comment by Comments Rating
15 Mar 2009 Map fields of a structure to output variables The program assigns each field of a structure into output arguments. Author: Hoi Wong Wong, Hoi

Thanks jos for the alternative approach that use deal(). The reason that I made this wrapper is to avoid using deal() and make the code self-documenting.

I wish Mathworks can consider allowing syntaxes like [a,b,c]=(struct2cell(S)){:}, then my submission has no reason to be here. :)

12 Mar 2009 Map fields of a structure to output variables The program assigns each field of a structure into output arguments. Author: Hoi Wong Jos (10584)

A superfluous combination of two basic ML commands. Simply using
C = struct2cell(S) ; [a,b,c] = deal(C{:}) ; in your code is clear enough.

07 Jan 2009 Nested Structure to Flat Cell Vector Tools to flatten a nested struct into cell Author: Hoi Wong Shilon, Ofek

Exactly what i needed, works like charm. thanks!

21 Apr 2008 Nested Structure to Flat Cell Vector Tools to flatten a nested struct into cell Author: Hoi Wong lee, e

I found this very handy, I wanted to do a simple check if a nested structure field existed or not, but it seems overly difficult to do this (exist doesn't work for nested structure fiels, isvar works for one level of nesting, etc.)
I was able to do a strcmp on the output to find if the nested structure field exists.

I would also really like to have a gui (like what is shown) that lets you see and edit the values of the structure easily. I would love to have a "tree grid" where nodes could be collapsed (similar to what you show on the right part of the screen shot, with an additional column for the values. But, maybe I am dreaming.

For handling "non-singleton struct branch" perhaps you can find some hints in the Geodise "xml toolbox", it seems to be able to parse pretty complicated matlab structures into xml.

Regards,
Eric

19 Feb 2008 Nested Structure to Flat Cell Vector Tools to flatten a nested struct into cell Author: Hoi Wong Wong, Hoi

Thanks Duane for the useful comments. I actually thought of spending more time on the help file, but I just find it quite difficult to describe what the program does without an example screenshot that has the structure displayed as a tree. I'll post a screen shot in a day or two, and I'd appreciate any help describing what this program does in simple words.

struct2cell() works for one level structures only. Hence if you have a structed formed by

a.b.c.d = 1
a.p.q.r = 2

struct2cell() will still give you cells that contains structs, which is not what I wanted (basically I want to form a table from a nested struct).

Also, in this context, since I want a list of all possible leaf nodes in a nested struct, using anything other than feval will make the program extremely clumsy. Please let me know if anybody has a better idea :)

I intentionally separate flatStructAccessList() from flatStruct() because some people might just want a list (like tree view) without the computational work putting all the contents into a cell vector.

By the way, "No vector (or cell vector)" should be written as "No non-singleton struct branch allowed". For structs, it's possible to have something like:

a{1}.b=1
a{2}.c=3
p(1).q=2
p(2).q=4

In this case, 'a' is a vector of cells which all the elements are structs, and 'p' is a vector which all the elements are structs. I don't know how to describe them in simple words, so please help!

If you found a good way to describe it, send me a email at wonghoi.ee@gmail.com.

Top Tags Applied by Hoi
annotation, argument, cell arrays, customization, data structure
Files Tagged by Hoi View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
30 Mar 2009 Map fields of a structure to output variables The program assigns each field of a structure into output arguments. Author: Hoi Wong dump, argument, variable, data structure, workspace, struct 12 2
26 Aug 2008 deltree Just like good old deltree.exe, but for MATLAB Author: Hoi Wong directories, file, path, deltree, utilities, files 5 0
20 Feb 2008 Screenshot Advanced hline and vline Draws horizontal/vertical lines in graphs. Accept axes handle and allows user to specify label posit Author: Hoi Wong horizontal line verti..., customization, graphics, plot, annotation 24 0
20 Feb 2008 Screenshot Nested Structure to Flat Cell Vector Tools to flatten a nested struct into cell Author: Hoi Wong nested struct flat ce..., structures, cell arrays 21 4
  • 3.66667
3.7 | 3 ratings
11 Feb 2008 Arbitrary files & MATLAB variables <-> data stream vector converter Encode any MATLAB data types into a numeric array, and vice versa Author: Hoi Wong external interface, file struct com data ... 11 0
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com