File Exchange

image thumbnail


version (7.72 KB) by Shiying Zhao
A complete implementation of TabPanel for MATLAB

1 Download

Updated 27 Jun 2006

No License

This is a complete implementation of TabPanel for MATLAB, which offers a consistent look and feel to the builtin MATLAB UI objects.

Two types of tabpanels are implemented. The first type is the usual tabpanel with tabs positioned on left/center/right top/bottom in relation to the visible panel. The second one is the so-called "popup" panels. This type of "tabpanels" is common in Windows and Java but has not been seen its use in MATLAB. I found that it is rather convenient in many occasions.

See the screenshot and "uitabdemo.m" to get started.

Cite As

Shiying Zhao (2020). uitabpanel (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (23)


Does this function work with R2014b release or newer ?


Does this work with GUIDE?


Sébastien MAILFERT


I have a quick question, if I have a figure with one tab panel (containing 5 or so tabs), how do I save that figure so that when I open it from the .fig file, all the tabs remain functional. Currently if I save the figure, when I reopen it, only the tab that I was on when I saved is still functional and the others are not responsive. Thanks!

Clayton Chu

Is there a callback associated with making a tab active? I am really hoping there is, but I can't find one. I want to resize the figure window based on the currently opened tab.


Very good

Sean Blackman


Great functionality! However, I am having trouble getting the Figure Toolbar to recognize the correct axes when they are on different tabs. As soon as I click on the 3D Rotate button and try to click on the desire axes, it changes the CurrentAxes to the first axes created, not the one I have set as active. Any ideas?

Again, great program!


Hi, i was wondering if there is a way to switch between tab without mouse clicking. I.e i load some data in a tab and then the program automatically switch to the processing tab without user tab selection. Thank you, samuele


Excellent implementation!

Spencer Alexander

Great code! Thanks a bundle!

I had issues with the same line as Saidual... when trying to embed the tabpanel in a figure other than the current figure, errors were being thrown.
I changed line 126 from:
cmenu = uicontextmenu;
cmenu = uicontextmenu('parent',parent);
Any my problems have since gone away.

Adrian Wanner

Saidul Hasnan

If you find errors when trying to add uitabpanel inside another uitabpanel. You might want to replace the following codes:

cmenu = uicontextmenu;
uimenu(cmenu,'Label','Goto Tab');


while ~findfigure

cmenu = uicontextmenu('Parent',testparent);
uimenu(cmenu,'Label','Goto Tab');


Saidul Hasnan


good looking GUI


Bharathiraja UN

I am withdrawing my last comment on code modification. Instead, it is better done as follows,
htab = uitabpanel(...
where as ResizeTab is the custom made resize function. Thanks.

Bharathiraja UN

It is working well.
I wish to suggest to modify line320-321 as follows to avoid some issues faced in resizing.

Franklin Quilumba

It is so great...

paolo castiglione

very good job! I hope newer versions of matlab will implement a tab function.

Liu Changkun

Excellent! Very GOOD!

Aaron Sui

Wonderful work! However I find it troublesome working with more that one figures.

Mirjam B

Benoît Muth

Outstanding work has been done here. Running the demo and exploring the scripts is enough to judge about the quality of this effort. I am really looking forward to see UITABPANEL implemented as a Matlab class like other objects. Anyway, thank you already!

MATLAB Release Compatibility
Created with R14
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!