MATLAB Answers

How to pass the value from GUIDE to app designer (local parameter to class def parameter)

조회 수: 2(최근 30일)
Lin Leo
Lin Leo 30 Mar 2020
댓글: Lin Leo 30 Mar 2020
Hi here
i have a question about how to pass the value to app designer.
example is:
in GUIDE (ui.m)
function ui_OpeningFcn(hObject, eventdata, handles, varargin)
handles.output = hObject;
a = 5;
ui_app_designer; % this is app designer file (ui_app_designer.mlapp)
call app designer(ui_app_designer.mlapp)
classdef ui_app_designer < matlab.apps.AppBase
% Properties that correspond to app components
properties (Access = public)
UIFigure matlab.ui.Figure
end
properties (Access = public)
Property % Description
a = ui.a; % this is wrong but how can i get the value a from ui.m ?
end
end
if you know, please tell me.
thank you very much.

  댓글 수: 4

표시 이전 댓글 수: 1
Lin Leo
Lin Leo 30 Mar 2020
Sami, thanks your reply.
i have a relate question.
in picture, app designer create the startupFcn but it can't edit, so i can't set the a value on startupFcn(app,a).
How can i edit this?
thank you.
Mohammad Sami
Mohammad Sami 30 Mar 2020
Click App Input Arguments button in app designer. You will then get a pop up. Type comma separated list of variables that you need the app to accept.
editor bar, app input argument
App Input Arguments Dialog
Lin Leo
Lin Leo 30 Mar 2020
Wow
Thank you very much.
i success to pass the value from guide to app designer!

로그인 to comment.

답변(0개)

이 질문에 답변하려면 로그인을(를) 수행하십시오.


Translated by