필터 지우기
필터 지우기

A script to create a single matrix from matrix in different matlab files

조회 수: 1 (최근 30일)
Hi Everyone,
Suppose I have many different Matlab files located in a folder. Let's say these files are called FileName_1, FileName_2, FileName_n.
Each of these files contains a vector A of equal dimensions (c,1).
What I wish to do is create a single matrix, that consists of all the different vector A in the different files.
How might I do this, so that the first column in the new matrix is vector A from FileName_1, the second is vector A from FileName_2, and so on?
Kind regards,
Ulrik.

채택된 답변

Daniel Shub
Daniel Shub 2011년 6월 29일
n = 10;
c = 100;
x = nan(100, 10);
for ii = 1:n
data = load(['FileName_', num2str(ii)]);
x(:, ii) = data.A;
end

추가 답변 (1개)

Sean de Wolski
Sean de Wolski 2011년 6월 29일

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by