Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

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

1 Ansicht (letzte 30 Tage)
Arthur Batte
Arthur Batte am 11 Jul. 2020
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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

Antworten (1)

madhan ravi
madhan ravi am 11 Jul. 2020
Bearbeitet: madhan ravi am 11 Jul. 2020
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 Kommentar
Arthur Batte
Arthur Batte am 11 Jul. 2020
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.

Diese Frage ist geschlossen.

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by