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

3 次查看(过去 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