How. do I combine variables into one Matrix?

I have about 25 stations with the same variable. I want to extract the variable from each file and combine them into one matrix, so that each column in the matrix is one station. The code below is what ive attempted but failed:
direc=dir('*.mat');
station=[];
for i=length(direc)
load(direc(i).name);
station=[station;zonal1.station];
end

답변 (1개)

Walter Roberson
Walter Roberson 2020년 12월 8일

0 개 추천

station(:, i) = zonal1.station(:);
This will fail if the data is not all the same size.

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

질문:

2020년 12월 8일

답변:

2020년 12월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by