Reputation: 145
I have a matrix NxN.
I want to extract values only from odd columns in this matrix.
http://photoload.ru/data/38/5d/d2/385dd20f148fd21a08de36a9c03e69a1.jpg
And after generate new matrix by this values.
How, I can do it?
Upvotes: 2
Views: 3228
Reputation: 961
% data is NxN matrix
newData = data(:, 1:2:end);
%The 1:2:end says start with first column, skip every other until end
Upvotes: 5