how to share data between two apps in app designer

6 Ansichten (letzte 30 Tage)
Ahmed SAIMI
Ahmed SAIMI am 16 Mär. 2019
Beantwortet: Abhinav am 5 Jul. 2023
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

Antworten (1)

Abhinav
Abhinav am 5 Jul. 2023
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.

Kategorien

Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by