Hi Ben,
Cracking piece of kit - should definitely become part of core MATLAB.
One issue though, - tabpanels don't appear to support 3D plotting with transparency. I have an application where I need two panels for 3D graphics and two for 2D graphics. I want to use lighting and transparancy in my 3D plots (so render with opengl). I'm having problems doing this.
For example:
f = figure();
p = uiextras.TabPanel( 'Parent', f, 'Padding', 5 );
axes( 'Parent', p );
plot( sin(0:0.1:2*pi) );
axes( 'Parent', p );
surf( peaks )
p.TabNames = {'Sin', 'Peaks'};
doesn't appear to work properly. A portion of the 3D axes are visible in the 2D panel. I can remove this effect by switching the renderer to zbuffer but then I can't use transparency.
I'm guessing that this has something to do with the way that MATLAB is rendering the components - does anyone have any ideas for a workaround?
Cheers,
B
None of the solutions you suggest works. But I find a way :
I declare the main_Vbox as a global variable, not a part of a structure. It's implies some adjustments in my code but it will work just fine!
Thank for your quick answer, it led me to a solution.
With respect,
Maxime Peuch.
Hi Max, can you try setting it using "dot" notation:
GUI_data.main_Vbox.Sizes = [...]
A few people in the comments above have noted some odd behaviour when you put layouts inside a struct. It seems that they are then not recognized as proper objects. An alternative is something like:
tmp = GUI_data.main_Vbox;
set(tmp, 'Sizes', [...]);
Let me know if either of these options help.
Ben
Hi Ben,
First of all, Great Work! It's exactly what I needed.
I have an issue :
I created a GUI. Using check-boxes, I want to resize the component of an Vbox but I have an error message.
I create the Vbox an put some Hboxes in it.
In the callback function of the check-boxes, I wrote :
set(GUI_data.main_Vbox, 'Sizes', [...]); %GUI_data is the global variable that handles all GUI components.
The error message is :
??? Error using ==> set
There is no 'sizes' property in the 'uipanel' class.
Error in ==> callback_function at 174
set(GUI_data.main_Vbox, 'sizes', sizes);
??? Error while evaluating uicontrol Callback
Apparently, in other functions, a Vbox in see as a uipanel. How can I change the 'Sizes' property from outside the function I create it ?
Thanks, Max.
4
10 Apr 2012
Cooccurrence matrix
Calculates cooccurrence matrix for a given direction and distance
Comment only