Like the title says. How do I find the index of a specific element in a matlab cell array? The content of the cell array contains both strings and numbers.
Toy example:
database = cell(4,2)
database(1,1:2) = {'Song', 'Rating'}
database(2:4,1) = {'Song1'; 'Song2'; 'Song3'}
database(2:4,2) = {1; 2; 5}
functionIWant(database, 'Song2') % Should return [3,1] or something similar
I know I can convert it to a matrix, iterate over it and thereby find the right index. I'm wondering however if there is any faster method working directly on cell arrays.