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.

Answers (1)

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,[])';

Asked:

on 1 Feb 2016

Answered:

on 2 Feb 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!