Are there any functions that will return the index of the last string in a cell of strings?

조회 수: 1 (최근 30일)
cell = {'a','a','b','b','c','c'}
function (cell, 'a') returns 2
function (cell, 'b') returns 4
function (cell, 'c') returns 6

채택된 답변

David Hill
David Hill 2020년 4월 1일
find(ismember(cell,'a'),1,'last');

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by