Hello,I have a matrix of nrows by 22 each .mat file. I want to take this data from each file and form a single matrix.the nrows in each file changes and the 22 columns remains same.could some one help me in solving this.

 Accepted Answer

KSSV
KSSV on 11 Jul 2021
matFiles = dir('*.mat') ;
N = length(matFiles) ;
iwant = zeros([],22,N) ;
for i = 1:N
load(matFiles(i).name) ;
iwant(:,:,i) = T ; % your matrix here
end

More Answers (0)

Categories

Asked:

on 11 Jul 2021

Answered:

on 11 Jul 2021

Community Treasure Hunt

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

Start Hunting!