How to merge data’s of multiple dot mat files in one dot matfile (one table)

조회 수: 1 (최근 30일)
Hello every one
I have multiple dot mat files like x0.mat, x1.mat, x2.mat, x3.mat
and each file contains 1D time series data. What I need is to merge those data found in each dot mat file in one dot mat file, which contains the name of the files with corresponding data's. I have attached the dot mat files
Thanks for your help

채택된 답변

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021년 5월 22일
Hi,
Here is a simple solution:
for ii=1:4
FN= strcat(['x' num2str(ii-1)], '.mat');
D=load(FN);
X_all(ii,:)=D.x; % OR: % x(ii,:)=D.x;
end
save('ALL.mat', 'X_all') % OR: save('ALL.mat', 'x')
Good luck.
  댓글 수: 6
Yared Daniel
Yared Daniel 2021년 5월 23일
편집: Yared Daniel 2021년 5월 23일
Thank you so much this worked prefectlly!!! I got all the information in 'X-Table'

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by