2010-05-06 6 views

답변

5

아니요, 직접 색인을 생성 할 수 있습니다.

%# create some test data 
m = magic(4); 
%# make binary image 
bw = m>10; 

%# read values from m 
values = m(bw); 

%# alternatively, if you have linear indices (as found via find)... 
linIdx = find(bw); 
%# ...you can use that instead 
values = m(linIdx); 
1

요소 단위의 곱셈을 사용하여 2D 구조를 유지할 수 있습니다.

m = magic(4); 
bw = m>10; 
m .* bw