Combine Matlab-Guide figures / Link a gui to another

3 次查看(过去 30 天)
Hello Matlab specialists,
I have a (very komplex) GUI, based on Matlab guide. Nowadays I have a simple import function in my "Gui_1", that loads csv files. But in the future I'd like to support even more data types (even binaries)... so I want to replace the import function with a dedicated Converter. This converter should also be another GUI. Something like this:
Here is my question:
Is it possible to link/call the "Converter Gui" from within the "Processing Gui"?
Some additional information:
>> ver
-----------------------------------------------------------------------------------------------------
MATLAB Version: 9.7.0.1190202 (R2019b)
MATLAB License Number: #########
Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 19042)
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
MATLAB Version 9.7 (R2019b)
GUI Layout Toolbox Version 2.3.4 (R2018b)
MATLAB Compiler Version 7.1 (R2019b)
>>
  3 个评论
Rik
Rik 2021-6-2
I would strongly discourage splitting up your GUI in a fig and an m file. That tends to be difficult to adapt. Using only an m file has another advantage: versioning software like git can understand the changes you make.
For general advice and examples for how to create/edit a GUI (and avoid using GUIDE), have look at this thread.
Marten Amschler
Marten Amschler 2021-6-8
@Rik @Walter Roberson, thank you for your input. I don't see a "like" button so I'll just answer here. It looks more complicated than i'd hope it'll be.
unfortunately it's to late to let go of GUIDE. But I could create another "additional gui" inside of a GUIDE function and use globals to output the parameters?!
%% Example Code within GUIDE to create an "additional GUI"
function push_Converter_Callback(hObject, eventdata, handles)
global output
figure(1)
h = uicontrol('Style', 'pushbutton', 'String', 'Import Data',...
'Position', [10+100 10 100 25], 'Callback', @push_import);
h = uicontrol('Style', 'pushbutton', 'String', 'Convert',...
'Position', [125+100 10 100 25], 'Callback', @push_convert;
%-- imaginary "import" function within the "additional GUI"
function push_import(varargin)
global input output
[file, path] = uigetfile('*.csv','MultiSelect', 'on','import CSV-data (multiple)');
input = load([path,file]);
%-- imaginary "convert" function within the "additional GUI"
function push_convert(varargin)
global input output
output = convert(input)
that should also work, right?

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by