How to find cell that contain word that i want ?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Arif
le 21 Fév 2024
Réponse apportée : Friedrich Welck
le 21 Fév 2024
hi guys, may you help me creating the code to get some data from the table. Please see the table below:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1623508/image.png)
Now im trying to get 'Hingestate' from cell 1H2, 2H2, 3H2, 4H2. I can collect it one by one like my code below:
columnhinge1H2 = hingeresult.HingeState(strcmp(hingeresult.GenHinge,'1H2'))
columnhinge2H2 = hingeresult.HingeState(strcmp(hingeresult.GenHinge,'2H2'))
columnhinge3H2 = hingeresult.HingeState(strcmp(hingeresult.GenHinge,'3H2'))
columnhinge4H2 = hingeresult.HingeState(strcmp(hingeresult.GenHinge,'4H2'))
but how can i get the four data in one variable ? Theese all contain the same word 'H2' right? so how to get thoose 'HingeState' data for all cell data which contains 'H2'
thanks i hope u understand
0 commentaires
Réponse acceptée
Friedrich Welck
le 21 Fév 2024
columnhingeAllH2 = hingeresult.HingeState(contains(hingeresult.GenHinge,'H2'))
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Characters and Strings dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!