필터 지우기
필터 지우기

how to share data between two apps in app designer

조회 수: 1 (최근 30일)
Ahmed SAIMI
Ahmed SAIMI 2019년 3월 16일
답변: Abhinav 2023년 7월 5일
greeting,
plz i try to how to share data between two apps in app designer
i folowed the exemples
it dosn't help me in my probleme , i need a simple easy exemple, of sharing TextArea.Value from 1st app to passe it to use it in the seconde app
in the first app code i try to stock the value of app.TextArea.Value and use it in the seconde app
properties (Access = public)
Filepath
end
methods (Access = private)
% Code that executes after component creation
function startupFcn(app)
% app.DATAGENUIFigure.Position = [500 400 297 137];
end
% Button pushed function: GeneratRotorDataButton
function GeneratRotorDataButtonPushed(app, event)
[FileName,PathName] = uigetfile('*.mat','Select the Rotor DATA file Path');
file=fullfile(PathName,FileName);
app.TextArea.Value=file;
load (file, 'rotortype')
handles.rotortype=rotortype;
rotortype=handles.rotortype;
app.Filepath=file;
if rotortype==1
ISOTROPDATAGEN
else
end
the seconde app code i need to load a .mat file automatecly without uigetfile window (Filepath is the path of my file to load)
function startupFcn(app)
load(app.DATAGEN.Filepath)
plzzzzzzz help me

답변 (1개)

Abhinav
Abhinav 2023년 7월 5일
To share data between two apps, please go through this documentation that explains about sharing data between different apps. But since you ask for a simple way to do so, you just need to save your variable in the workspace and can use it later, You could use assignin() to move your data to the workspace and then load it.

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by