How to sort orders of rows?

1 次查看(过去 30 天)
Hi, I have a matrix, which I need to sort in two group: First group: Pick first 5 rows (and all columns) and leave next five rows and again pick another five, leave next five and so on. Second group: Pick only those which were not selected in first group.
Thanks in advance.
  1 个评论
Laliguras
Laliguras 2013-3-28
As follow-up to previous question, how do I get the average value (mean) of each of those picked 5 rows?
Thanks

请先登录,再进行评论。

采纳的回答

Azzi Abdelmalek
Azzi Abdelmalek 2013-3-27
编辑:Azzi Abdelmalek 2013-3-27
Example
A=rand(20,6);
idx=reshape(1:size(A,1),5,[]);
m=size(idx,2);
idx1=idx(:,1:2:end);
idx2=idx(:,2:2:end);
A1=A(idx1(:),:)
A2=A(idx2(:),:)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Shifting and Sorting Matrices 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by