Run a gui from a .mat file, save the variables from that gui and use them in the .mat code.
1 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
Romain
2014-5-26
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 个评论
Romain
2014-5-26
编辑:Romain
2014-5-26
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
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!