share/load data (mat-file) AppDesigner
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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
Réponse acceptée
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
Plus de réponses (0)
Voir également
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!