Matrix slicing in matlab
43 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
i have a matrix in which i need to slice into elements but in cell array form
0 Kommentare
Antworten (1)
Paul
am 4 Sep. 2021
Use mat2cell
x = rand(4,2); % the matrix
c = mat2cell(x,[2 2],2); % the cell array
% verify
c{1} - x(1:2,:)
c{2} - x(3:4,:)
2 Kommentare
Paul
am 4 Sep. 2021
x = rand(6,8);
% assuming row and column dimensions of x are both even
c = mat2cell(x,2*ones(1,size(x,1)/2),2*ones(1,size(x,2)/2))
c{2,2} - x(3:4,3:4)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!