How to split one big matrix in several matrices?
이전 댓글 표시
I'm trying to split a 72x10 matrix in 10 24x3 matrices. The new matrices need to have in each line, 3 elements (which make 3 columns) of each column of the original 72x10 matrix. I tried to use mat2cell but always get the error "Input arguments, D1 through D2, must sum to each dimension of the input matrix size, [72 10]". I'm clearly not understanding something here.
댓글 수: 2
AMBIKA P S
2019년 2월 20일
편집: AMBIKA P S
2019년 2월 20일
Also, could someone please clarify on how to split a 70x6 matrix into seven 10x3 matrices using the above code? What is 'V' here? Is it a function which we use to perform other calculations on the split matrices? and also, what is 'a'?
numOfSensors = 10;
numOfSets = 7;
%% sample data preparation
x = 1:3;
y = rand(length(x), numOfSets*numOfSensors);
yCell = mat2cell(y, 3, numOfSensors*ones(1,numOfSets)); % this is my sensor data
ycell = {3x10} {3x10} {3x10} {3x10} {3x10} {3x10} {3x10}
I have converted the matrix to cell arrays. How do i use scatter3 on each cell array.
Could someone please clarify? Thank you for your help in advance
Walter Roberson
2019년 2월 23일
Is the "70x6" a mistake? You show a 3 x 70 array and ask about spitting into something that has as many total elements as would be present in (3 x 70); if the original data is 70x6 then half of the inputs need to be omitted in the output.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!