call callback function in my code

5 ビュー (過去 30 日間)
Luca Re
Luca Re 2024 年 10 月 19 日
回答済み: Walter Roberson 2024 年 10 月 19 日
function SaveDataButtonPushed(app, event)
list=app.portFolio_struct.List(:,1);
[eq,sis,RifSis]=MPV_SERAFINI_Load_PortfolioManage(app,list);
[MPV_Portfolio_readSaved.Eq]=eq;
[MPV_Portfolio_readSaved.Sis]=sis;
[MPV_Portfolio_readSaved.RifSis]=RifSis;
[MPV_Portfolio_readSaved.dateSavePtf]=datetime('today','Format','dd/MM/yyyy');
save('MPV_Portfolio_readSaved.mat','-struct','MPV_Portfolio_readSaved');
app.MPV_Portfolio_readSaved=MPV_Portfolio_readSaved; %%lo metto nelle proprieta perche lo carico all'inizio allo scopo di visualizzare il campo [MPV_Portfolio_readSaved.dateSavePtf]
end
hi, if i press this button (see pics) it call SaveDataButtonPushed(app, event) and it's ok
but if in my code i call it
if app.ReadSaveDATACheckBox.Value %% se sono qua e ReadSaveDATACheckBox e' =1 vuol dire che
app.SaveDataButtonPushed(app)
end
i get this error
annot access method 'SaveDataButtonPushed' in class 'MPV_PortFolio'.
How can i call this function in my code?

採用された回答

Walter Roberson
Walter Roberson 2024 年 10 月 19 日
You will need to set the Access attribute of the method definition to permit your code to call the method. https://www.mathworks.com/help/matlab/matlab_oop/method-attributes.html

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by