I have a few GUI's in MATLAB and I need to view them in different tabs - matlab

I have 3 GUI files created using GUIDE. I need to have a tab Panel where I can view all of them in different tabs.

There is no straightforward way to accomplish that. A figure cannot be displayed inside another figure. GUIDE creates figure. You can convert your GUIDE figure to programmatical GUI by using some conversion procedure. There is one official by Mathworks, or other ones on file exchange. Then, you should place the 3 figures children inside a panel each.

There is no tab object in MATLAB. You can generate your own by making your own graphical objects: the tab buttons, that users can click to run a function that puts the right "tab" in front using uistack to change the order of your graphical objects, always bringing the clicked tab to the front.
But you would do this all in one GUI, in one figure window; you just not to make sure that hold is on in the figure, and you have to give all your plots a handle so that you can manipulate them with uistack.

Related

Matlab guide starts with axes already plotted

I created an application using GUIDE called (main). Inside the form (figure), i dragged and dropped many components, one of them is an axes component. When i run the application, it shows allways the same plot. GUIDE generated applications have an opening function, in my case, main_OpeningFcn. I already tried to clear (cla) it in the first line of main_OpeningFcn function, but it first blinks and old plot and then clears it. I am sure it is an old plot, i can recognize it. It seems like this old plot had been saved somewhere and everytime the application starts, it is shown. Is there any cache or something like that?
Maybe you accidently clicked on the save icon in your figure from the gui-window (not guide-window). Now when you open your gui, matlab will not create an empty plot, but will load whatever is saved in the fig-file, that exists beside the m-file for your guide-application.
To solve the issue, you need to delete the figure in your guide-editor, an place a new figure instead. And try to hide the menubar to avoid clicking the save icon again, if your gui is open.

Enable some component visibility in MATLAB GUI figure after a selection?

I have a simple question about matlab GUI?
how can i Enable some component visibility in MATLAB GUI figure? For an easy understanding i am using a fgure to explain my problem.
I wanted to do something like.
After Running my Gui. i wanted to show only a specific pushbutton rather all the components
as shown in Figure 1
Once i click on Lets ADD Button the figure 2 should appear
After selecting a number my Other Components should appear as shown in figure 3.
Sorry if my Words are misleading to you as i do not have a good command on technical words.
Thanks..........
You need to detect the event (i.e. press button) and create a function for that.
There you will need to enable the visibility of whatever you want like:
set(handles.pushbutton1,'visible','on')

MATLAB: GUIDE "Save Figure" toolbar button

I created a Gui in GUIDE and added the predefined "Save" toolbar button in guide->tools->toolbar. When i press the save button, the next time i open the GUI it will show the saved values and axes.
Now i would like to remove that feature again, but only removing the save button doesn't seem to work. The Gui still opens with the last saved values.
Is there a way to clear the saved data?
It appears that no further answers are forthcoming, and since I just ran across the same issue, this is what I did.
Open the object browser and determine which ones changed;
In my case it changed two text boxes as well as the axes.
Open the properties inspector for the changed objects and edit as required to return them
to their original states. I replaced the string property with the correct values.
It's too difficult to figure out how to make the axes object revert to it's old state. You can create a 2nd temporary axes and copy those states to the first axes; but I found this doesn't work. Instead, delete the old axes, create a new axes in it's place, and rename the tag to match the original. If there are any callbacks, make sure they're in the right place and delete the old one.
That's it. Good luck.

How to display a scrollable grid of images in matlab GUI

How can i display a scrollable grid of images in matlab GUI?
I want something similar to what is shown below
This stackoverflow post describes a way of displaying images in a uitable by setting the 'String' property to an HTML code pointing to an image. But this requires me to save the images to disk which is not an option i would like as these displays are fired up dynamically.
It would also be nice, if i could add a checkbox inside each image so the user can select a subset of them.
You can use this tool. In the gui, you should be able to scroll through. But to have title below every image you might have to edit the tool.
Sample output:
a grid of images http://www.mathworks.in/matlabcentral/fx_files/22387/12/imdisp.jpg
The answer is here:
How can I use scrollbars in MATLAB figure windows when viewing large GUIs?
-> Note: This is a workaround, scrollbars are not available for Matlab-figures
I would suggest to use the tool Prashanth presented in his awnswer and combine it, by putting all elements within the panel.

How to display our output meseeges into specified uipanel in Matlab GUI?

I want to display my output messages that have processes in a function. The message is stored in a variable.
In the GUI window, I made an uipanel with tag=uipanel1.
So, my question is how do I display my messages in the specified uipanel that I made (uipanel1)?
Any ideas?
There are many ways to do this, but it is hard to guess the most appropriate way without some information on what you already tried. I would suggest the following options:
If your uipanel is not high and is used much like statusbar in gui applications then you better add a static text component to it and update its text through its handle.
While static test can also display multiline text it will not display scrollbars. If you want to display something like a message log window with several lines visible and scroll bars, I'd suggest to add a listbox instead. However, it will be a little tricky if you want to show only limited number of most resent messages.