hello community, I'm new in app designer and I'd like to ask your support to understand how to process some data.
I got a .mat file that contains data (vectors) each vector has different name:
I created a funtion to load above data to read values from EGSDCmn_mfEgCat1B1Parl_1
properties (Access = public)
var1 = load('C:\Users\T0104G4\Documents\MATLAB\ECT\practise\Data.mat') % Load mat files
end
methods (Access = public)
function results2 = fun1(app)
results2=app.var1.EGSDCmn_mfEgCat1B1Parl_1;
end
end
my target is to push a button to see that data in a app.TextArea
% Button pushed function: LoadDataButton
function LoadDataButtonPushed(app, event)
app.TextArea_2.Value = fun1(app)
but I got this error
any advice/feedback will be highly appreciated.
thanks

回答 (1 件)

Ram Prasanth
Ram Prasanth 2024 年 5 月 7 日

1 投票

Hello A-Rod,
You need to first load the file and store it in a variable.
This Variable must be centrailized such a way that enitre app uses this variable.
for Example:
properties (Access = public)
var=load('\path_to_location\example.mat'); % specify the path to mat file
end
methods (Access = public)
function results = fun1(app)
results=app.var.d;
end
You can first start with this sample example.mat
You can create some variables inside the .mat file and try it.
here is the documentation of Matworks for App Designer.

1 件のコメント

Dongijn Shin
Dongijn Shin 2025 年 2 月 28 日
編集済み: Dongijn Shin 2025 年 2 月 28 日
Thank you so much I struggled for 2 hours and finally got the answer!!!!!!!!!!!!!!!!! YEAH!!!!!

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeDevelop Apps Using App Designer についてさらに検索

製品

質問済み:

2024 年 5 月 7 日

編集済み:

2025 年 2 月 28 日

Community Treasure Hunt

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

Start Hunting!

Translated by