Adding other function calls in GUI Matlab

In summary, to add a function to every tab in a GUI Matlab, you can use callback functions for each tab button to call the desired function and display the output. This can be done using the code from the file exchange link provided.
  • #1
khalidhameed
1
0
I used the following code to make simple tabs in GUI Matlab , now I wanted to add the another function in that so as the result of the added function is displayed when I press the GUI tab buttons

http://www.mathworks.com/matlabcentral/fileexchange/15193-simple-tab-panel/content/simpletab.m for example If I want to add a function to every tab, when I press tab 1 added function ouput (in this case graphs)is displayed.
I have reviewed various tutorials but I am not been able to figure it out. I am new to Matlab and I am really worried how to end up with this.
Thanks
 
Physics news on Phys.org
  • #2
in advance.You can use the callback functions for each of the tab buttons to call the desired functions and display the output. For example, you can use the following code for the callback for the tab button "Tab 1": function tab1_Callback(hObject, eventdata, handles) % Call your desired function here [outputs] = desired_func(); % Display the outputs from the function figure;plot(outputs); end
 

Related to Adding other function calls in GUI Matlab

1. What is the purpose of adding other function calls in GUI Matlab?

The purpose of adding other function calls in GUI Matlab is to enhance the functionality of the GUI. This allows for the incorporation of additional features, such as data processing or analysis, to be performed within the GUI itself.

2. How do I add other function calls in GUI Matlab?

To add other function calls in GUI Matlab, you need to first create a function file that contains the code for the desired function. Then, you can use the "Callback" property of a GUI object to call the function when the object is interacted with. Alternatively, you can use the "pushbutton" object to create a button that executes the function when clicked.

3. Can I add multiple function calls in one GUI Matlab file?

Yes, you can add multiple function calls in one GUI Matlab file. This can be done by creating separate function files for each function and then calling them using the "Callback" property or by creating multiple buttons that execute different functions.

4. What is the syntax for adding other function calls in GUI Matlab?

The syntax for adding other function calls in GUI Matlab varies depending on the type of GUI object you are using. However, the general format is "objectName.Callback = @functionName". This tells the object to call the specified function when it is interacted with.

5. Are there any limitations to adding other function calls in GUI Matlab?

Yes, there are some limitations to adding other function calls in GUI Matlab. For instance, the function must be properly defined and the input and output arguments must be correctly specified. Additionally, certain GUI objects may have restrictions on the type of functions that can be called. It is important to carefully read the documentation and guidelines when adding other function calls in GUI Matlab.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
16K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
20K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
Back
Top