Find row where cell value equals some defined value
이전 댓글 표시
Hi,
I have a list called quarters that looks something like:
1999Q2
1999Q3
1999Q4
2000Q1
I would like to find out which row is for example 1999Q4. So I have defined:
quarter_find='1999Q4'
How could I find the right row? I tried with find function: [row_equal]=strfind(quarters, quarter_find)
I get
[]
[]
1
[]
How could I actually get number of row where those values are equal? (so in this case I would like to ger answer=3)
Could anyone please suggest me something?
Thanks,
Ieva
채택된 답변
추가 답변 (1개)
Jan
2012년 3월 23일
0 개 추천
The command posted by Andrei is the best Matlab solution I know, but it does not look nice, althozugh this is a standard problem. Therefore I'm using FEX: strncmpr. This function is equivalent to strncmp, but processes the strings from the right. E.g. this helps to filter file names by their extensions.
카테고리
도움말 센터 및 File Exchange에서 Whos에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!