필터 지우기
필터 지우기

How to find the corresponding position in a string

조회 수: 2 (최근 30일)
peter huang
peter huang 2022년 8월 30일
편집: Matt J 2022년 8월 30일
How to find the corresponding string in a string set test_str = ['a';'b';'c'] test_str = 'a' 'b' 'c' How can i find out c and the output string is at position 3 of c

답변 (2개)

Matt J
Matt J 2022년 8월 30일
편집: Matt J 2022년 8월 30일
test_str={'a','b','c'};
[exists,location]=ismember('c',test_str)
exists = logical
1
location = 3

Matt J
Matt J 2022년 8월 30일
편집: Matt J 2022년 8월 30일
test_str=['a','b','c']
test_str = 'abc'
location = strfind(test_str,'c')
location = 3

카테고리

Help CenterFile Exchange에서 String Parsing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by