overlap the same data 5 times

조회 수: 1 (최근 30일)
Kishore
Kishore 2022년 8월 15일
댓글: KSSV 2022년 8월 16일
Hello,
I want to overlap the same mat file data five times. For example: I have 5 separate mat file data with same matrix value. Each mat file having its matrix of 11111x23.
Now i want to overlap all the data into one mat file.
I want my output like this at end,
Inputs: 11111x23
11111x23
11111x23
11111x23
11111x23
Output: 55555x23
Can someone please help me to solve my problem.
Thank you

답변 (1개)

KSSV
KSSV 2022년 8월 15일
Let M be the matrix in your mat file.
matFiles = dir('*.mat') ;
N = length(matFiles) ;
iwant = [];
for i = 1:N
S = matfile(matFiles(i).name) ;
iwant = [iwant ; S.M] ;
end
  댓글 수: 2
Kishore
Kishore 2022년 8월 16일
What is .name on the comment????
Is that a format of a file or something else?
KSSV
KSSV 2022년 8월 16일
That is not a comment. matFiles is a structure, this has a filed called name, which has the mat file name.

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

카테고리

Help CenterFile Exchange에서 Workspace Variables and MAT-Files에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by