필터 지우기
필터 지우기

How to display the row number ?

조회 수: 3 (최근 30일)
Matlab111
Matlab111 2015년 2월 1일
답변: Image Analyst 2015년 2월 1일
i want to know how to display a row numbers in this example:
a=[ 'X' 'Y' 'Z'
30.4596 37.6811 93.0000
154.6678 172.8173 91.0000
44.7308 175.6077 94.0000
90.8282 191.0239 91.0000
149.5394 149.1930 70.0000];
b= 'Z'
[93.0000];
tolerance = 0.00001;
% Subtract third columns
matches = abs(a(:,3) - b) < tolerance
% Extract matching rows.
c = a(matches, :)
if you run this code you will get number of matches 'b' with 'a', and now i want that row number also to display, which means that if 'b' is matched with 'a'(column 3), now i have to display the corresponding row number.
Output should be like
d=[1];%(represent row number)
NOTE: Want to display 'b' is belongs to which number of row's in 'a'

채택된 답변

Matt J
Matt J 2015년 2월 1일
d=find(matches)
  댓글 수: 1
Matlab111
Matlab111 2015년 2월 1일
ya k, but if 'b' is dose not matched with 'a' than it's showing empty matrix like this
" Empty matrix: 0-by-1"
so now i want to delete this " Empty matrix: 0-by-1 " empty matrix.

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

추가 답변 (1개)

Image Analyst
Image Analyst 2015년 2월 1일

카테고리

Help CenterFile Exchange에서 Geometric Transformation and Image Registration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by