Accessing one value in an array
Ältere Kommentare anzeigen
Let's say I have an array C
C = {'frog'; 'cat'}
and I want to just pull the first letter of the first cell, is that possible?
For context, I am trying to use this in the regexpi function to search for a word that starts with the same letter as one of the terms in the array, but in a loop or else I could just use:
C = {'frog'; 'cat'}
exp = 'f\w*'
frog = regexpi(C, exp)
Not sure if it is possible, or maybe I'm just way over thinking it and the answer is super simple. Thanks!
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Characters and Strings finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!