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.
1 view (last 30 days)
Show older comments
help please
Answers (1)
Andrei Bobrov
on 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,[])';
0 Comments
See Also
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!