share/load data (mat-file) AppDesigner

3 vues (au cours des 30 derniers jours)
dario cecchetti
dario cecchetti le 12 Mai 2018
Commenté : Ameer Hamza le 13 Mai 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
  1 commentaire
dario cecchetti
dario cecchetti le 12 Mai 2018
Very clear! Great! Thanks!

Connectez-vous pour commenter.

Réponse acceptée

Ameer Hamza
Ameer Hamza le 12 Mai 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 commentaires
dario cecchetti
dario cecchetti le 12 Mai 2018
Great! Thanks for all!!!
Ameer Hamza
Ameer Hamza le 13 Mai 2018
You are welcome.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Environment and Settings dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by