How to upload mat files in Matlab App Designer?

2 ビュー (過去 30 日間)
Tajana Lusetic
Tajana Lusetic 2019 年 10 月 7 日
コメント済み: Tajana Lusetic 2019 年 10 月 7 日
Hi,
I have to upload some mat files in Matlab App designer. The code in matlab for uploading is:
location = 'Name of the location';
testData = imageDatastore(location, 'FileExtensions', '.mat', 'IncludeSubfolders',true, ...
'LabelSource','foldernames')
testData.ReadFcn = @readFcn1
How do I write this in Matlab App Designer?
Thank you
  2 件のコメント
Adam
Adam 2019 年 10 月 7 日
You can write code exactly the same in app designer as you can anywhere else. What you want to do with it obviously determines exactly how you hook it up, but to load a mat file in app designer is no different to doing it in a regular function.
Tajana Lusetic
Tajana Lusetic 2019 年 10 月 7 日
I want to be able to choose multiple files from a directory (for my pretrained Neural Network), and I wrote this code
DataLocation=uigetdir(Location of the Data); testData=imageDatastore(fullfile(DataLocation),'FileExtensions','.mat','IncludeSubfolders',true,... 'LabelSource','foldernames');
app.data=testData;
app.data.ReadFcn=@readFcn1;
And when I open the folder, it is empty(it's not showing me my files) and I get an error
Error using imageDatastore.
Files must be a non-empty character vector or string scalar.
So I am stuck.

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by