How can I convert multiple mat files in one csv file for my dataset, or can create datasource for further processing with feature extraction method. There are 2 matrices. testCase fields are shown and another is IAT i.e. continuous time series data.

12 ビュー (過去 30 日間)

採用された回答

Pankhuri Kasliwal
Pankhuri Kasliwal 2020 年 10 月 7 日
Hi,
Try this :
d=dir(fullpath(dirname,'*.mat'));
for i=1:length(d)
load(d(i).name % will leave whatever variable is in mat-file in memory
[p,n]=fileparts(d(i).name); % get path, name w/o extension
csvwrite([fullfile(p,n) '.csv'],X) % write to name w/ .csv extension
end
Additionally, refer to the following links for more details :
  1 件のコメント
Ritu Dahiya
Ritu Dahiya 2020 年 10 月 8 日
Hi Pankhuri,
Thanks a lot for answering my query.I am able to read all the files by creating a directory. But when I am trying to open those files in excel, I am able to get data of iat matrix only which contains double datatype. TestCase is a structure with 11 fields in each file but I am unable to see that data. Please let me know how I can get complete data from the mat files, one being a double and another a structure. However, the number of elements in each file are same.
Please let me know, how can I read both the structure type and matrix from each file with same variables.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDatabase Toolbox についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by