how to share data between two apps in app designer
14 ビュー (過去 30 日間)
古いコメントを表示
greeting,
plz i try to how to share data between two apps in app designer
i folowed the exemples
and https://fr.mathworks.com/help/matlab/creating_guis/creating-multiwindow-apps-in-app-designer.html
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
0 件のコメント
回答 (1 件)
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.
0 件のコメント
参考
カテゴリ
Help Center および File 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!