find element egual to substring in array string
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
aldo
le 21 Nov 2023
Réponse apportée : Dyuman Joshi
le 21 Nov 2023
c=["A1_asd";"A2_rrd";"A_dj";"B1_gre";"B2_rffe";"B3_rffe"]
%i want to catch string before letter_ and search member
%find all member egual to A in c;
%find all member egual to B in c;
result:
["A1_asd";"A2_rrd";"A_dj"]
["B1_gre";"B2_rffe";"B3_rffe"]
0 commentaires
Réponse acceptée
Dyuman Joshi
le 21 Nov 2023
From what I understood of the given information -
%Input
c=["A1_asd";"A2_rrd";"A_dj";"B1_gre";"B2_rffe";"B3_rffe"]
%Output
a = c(startsWith(c, 'A'))
b = c(startsWith(c, 'B'))
0 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!