필터 지우기
필터 지우기

Combine Matlab-Guide figures / Link a gui to another

조회 수: 3 (최근 30일)
Marten Amschler
Marten Amschler 2021년 6월 2일
댓글: Marten Amschler 2021년 6월 8일
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