Borrar filtros
Borrar filtros

how to share data between two apps in app designer

5 visualizaciones (últimos 30 días)
Ahmed SAIMI
Ahmed SAIMI el 16 de Mzo. de 2019
Respondida: Abhinav el 5 de Jul. de 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

Respuestas (1)

Abhinav
Abhinav el 5 de Jul. de 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.

Categorías

Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by