Find the index of elements in a string vector - MATLAB Cody - MATLAB Central

Problem 45331. Find the index of elements in a string vector

In the vector of v, find the index of elements specified by a.

v = ["Lion","Koara","Elephant","Snake","Dog","Cat","Camel"];

a = ["Koara","Snake","Dog"];

ans = [2,4,5]

Solution Stats

74.07% Correct | 25.93% Incorrect
Last Solution submitted on May 05, 2025

Problem Comments

Solution Comments

Show comments
PIVlab surpasses 100K all-time File Exchange downloads
During the past twelve months, PIVlab, a MATLAB Community Toolbox for particle...
4
8

Problem Recent Solvers36

Suggested Problems

More from this Author1

Problem Tags

Community Treasure Hunt

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

Start Hunting!