필터 지우기
필터 지우기

select 2 rows in a (n,m) matrix

조회 수: 1 (최근 30일)
jaah navi
jaah navi 2018년 1월 4일
댓글: Rik 2018년 1월 5일
what command can be used to select 2 rows in a matrix(10,10),3 rows in a matrix(10,10),4 rows in a matrix (10,10)

답변 (2개)

KL
KL 2018년 1월 4일
편집: KL 2018년 1월 4일
I suppose you want to randomly sample 1,2 or 3 rows from your matrix.
A = rand(10); % example
noRows = 1;
A_sample = A(randperm(size(A,1),noRows),:);

Torsten
Torsten 2018년 1월 4일
rowi = A(i,:);
selects the i'th row from the matrix A.
Does this help ?
Best wishes
Torsten.
  댓글 수: 1
Rik
Rik 2018년 1월 5일
This is the solution they should be looking for. And knowing that i can be a vector.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Axis Labels에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by