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

2 visualizzazioni (ultimi 30 giorni)
cell = {'a','a','b','b','c','c'}
function (cell, 'a') returns 2
function (cell, 'b') returns 4
function (cell, 'c') returns 6

Risposta accettata

David Hill
David Hill il 1 Apr 2020
find(ismember(cell,'a'),1,'last');

Più risposte (0)

Categorie

Scopri di più su Data Types in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by