how to sort a matrix

조회 수: 1 (최근 30일)
Bruce Nicayenzi
Bruce Nicayenzi 2012년 2월 21일
hi I have a big matrix A = [k x 1] where k is around 10,000 and k ranges from, say, a to b
i need get a matrix B from A for all the values of k ranging from a to c, where a < c < b;
I've tried everything by can't figure out how to do it.
Thanks,
B.

답변 (2개)

Andrei Bobrov
Andrei Bobrov 2012년 2월 21일
eg
a = 12
b = 125
A = randi([a b],20,1)
c = (a + b)/2;
B = A(A < c)

Sukuchha
Sukuchha 2012년 2월 21일
this should work A(A>a & A <b)

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by