MATLAB: How to get the row indices

statisticsStatistics and Machine Learning Toolbox

Hi,
I have the below array, and I want to get the idices of names starting with PRS.
PRS.BG02K65E5T9
PRS.UG02K145E5T20
Ark.prgrma
YUI_PRS.UG02K145E5T20
PRS.GG02K200E6T20
1. I want to know which row of name start with PRS. (row1,2,5) 2. Count of names starting with PRS. and not start with PRS. (3 &2)
Many thanks in advance,

Best Answer

S = { 'PRS.BG02K65E5T9',
'PRS.UG02K145E5T20',
'Ark.prgrma',
'YUI_PRS.UG02K145E5T20',
'PRS.GG02K200E6T20'};
find(strncmp(S,'PRS',3))