share/load data (mat-file) AppDesigner

3 visualizaciones (últimos 30 días)
dario cecchetti
dario cecchetti el 12 de Mayo de 2018
Comentada: Ameer Hamza el 13 de Mayo de 2018
Hy everybody, I would share soma variable from mat-file (workspace_invaso.mat) in AppDesigner, but I can't do it. I don't want to load the mat-file in every callback function. Best regard, Dario
% code
classdef Volume_invaso_1 < matlab.apps.AppBase
% Properties that correspond to app components
properties (Access = public)
UIFigure matlab.ui.Figure
UITable matlab.ui.control.Table
VOLUMEUTILEDINVASOLabel matlab.ui.control.Label
CapacitTextAreaLabel matlab.ui.control.Label
CapacityTextArea matlab.ui.control.TextArea
Button_Filo_Teso matlab.ui.control.Button
Button_Rippl matlab.ui.control.Button
Button_Peaks matlab.ui.control.Button
end
properties (Access = private)
load workspace_invaso.mat % Share variables
end
methods (Access = private)
% Code that executes after component creation
function startupFcn(app)
load workspace_invaso.mat;
app.UITable.Data=[Q_serie.annuale,Ve,Qu,Vu,Vc];
app.UITable.RowName={'Gennaio';'Febbraio';'Marzo';'Aprile';'Maggio';...
'Giugno';'Luglio';'Agosto';'Settembre';'Ottobre';'Novembre';'Dicembre'};
end

Respuesta aceptada

Ameer Hamza
Ameer Hamza el 12 de Mayo de 2018
The startupFcn just execute once, at the start of the app, so you are loading the file just once, not at every callback.
  4 comentarios
dario cecchetti
dario cecchetti el 12 de Mayo de 2018
Great! Thanks for all!!!
Ameer Hamza
Ameer Hamza el 13 de Mayo de 2018
You are welcome.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Environment and Settings en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by