Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Stacking many vector data into one resultant vector data but of the same length

조회 수: 2 (최근 30일)
Arthur Batte
Arthur Batte 2020년 7월 11일
마감: MATLAB Answer Bot 2021년 8월 20일
Hi is there anyone who could direct me on how i could stack my data without increasing the length of the output. i have tried to use the stack function but apparently, the length of the resultant is larger than the input. i have attached a file of 10 columns and each column has a length of 15493 records. i would wish to stack all the 10 into 1 with a length of 15493. Is there something that can be done?
thanks

답변 (1개)

madhan ravi
madhan ravi 2020년 7월 11일
편집: madhan ravi 2020년 7월 11일
nrecords = 10;
Data = cell(nrecords, 1);
for k = 1:nrecords
Data{k} = dlmread(sprintf('data%d.txt',k));
end
celldisp(Data)
DATA = cat(3, Data{:}) % as 3D
  댓글 수: 1
Arthur Batte
Arthur Batte 2020년 7월 11일
thanks madhan, but i think u misunderstood me, what i wanted is to stack all the ten records into one record but of the same length.

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by