Run a gui from a .mat file, save the variables from that gui and use them in the .mat code.

1 view (last 30 days)
i have a matlab code, in this program i use some images and save them as variables in the program. What i do is binarize an image (in a section of the code). For that i created a GUI that opens the image, converts it to grayscale and binarize the image. What i need to do is run the current program. In the required section, call my GUI, binarize the image in that GUI, save the binarized image and return to the program and continue with the other sections. How can i do that? calling the GUI and use the results from the gui in my code? I'm new at GUI's, i need a little help. Thanks.

Answers (1)

Romain
Romain on 26 May 2014
I'm not sure to understand what you want to do, but a GUI function works like any other function. You can call it in function/script using
Outputs = MyGui(Inputs)
So you can call your GUI in the main program and the outputs of your GUI will be available in this program.
Hope to helps
  3 Comments
Romain
Romain on 26 May 2014
Edited: Romain on 26 May 2014
So my answer should answer your problem. Call your GUI like a function when needed, and you will be able to use the GUI Outputs latter in the code. You can use the function 'waitfor' to be sure to wait until your GUI is close before running the end of your program
doc waitfor
Alejandro
Alejandro on 26 May 2014
ok. i'm going to try that. I'll tell you later if i could do it and accept the answer. Thanks!

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!