Sferle Alin-Tudor posted a question which may contain the answer to this question, earlier - 30 May 2021. Thanks, Sferle!
read multiple channels of different amounts of data into single matrix
조회 수: 5 (최근 30일)
이전 댓글 표시
I have working code which reads different size data arrays from different files. Each array (matrix) originates from a different data "channel." Although there are differing amounts of data produced by each channel, each channel matrix has the same number of columns.
I want to combine all the data into a single array of data so it can be refernced by channel number. The resulting larger data matrix will thus have one additional column [compared to the channel data]; that column will be the channel index.
For example:
for ch = 1:10
chdata = ReadChData(ch);
% Add channel #ch data to larger matrix (DataMatrix) so that:
% chdata = DataMatrix(ch, ...)
% where the '...' would be replaced by the appropriate number of columns
end
I'm not sure how better to represent the general case so here's a specific example with 6 columns of data, for channel # nc:
chdata(:, :, :, :, :, :) = DataMatrix(nc, :, :, :, :, :, :)
(I do know or can determine the number of columns of data and it is consistent across channels. Each channel's data is read from a file in cell format and converted to a matrix, in case that makes a difference.)
댓글 수: 5
채택된 답변
추가 답변 (1개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!