A=[1,3,5;9,8,7;10,15,20] use A and matrix addressing to create a 2x3 matrix consisting of the first two elements of the first column, the last two elements of the 2nd column, and the first two elements of the last row.
Ältere Kommentare anzeigen
Antworten (1)
Andrei Bobrov
am 2 Feb. 2016
A = randi(125,30,3);% Let A - your data.
b = A';
k = 3:6:numel(A);
b([k,k+1]) = nan;
out = reshape(b(~isnan(b)),2,[])';
Kategorien
Mehr zu Logical finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!