How to use assert to prevent cell contains thing which is false

3 vues (au cours des 30 derniers jours)
Arif
Arif le 21 Fév 2024
Commenté : Voss le 23 Fév 2024
Hi guys im trying to use assert to prevent my cell-array data contains 'B to C'. Here is my cell-aray data :
what function that can i used to assert that meet theese condition :
  1. True when in cell-array dont contains 'B to C'. It can be anything like 'A to B'
  2. False when in cell-array contains 'B to C'
If there is one or more cells which are 'B to C', then it should stop my code then give warning message "Structure collapsed"

Réponse acceptée

Voss
Voss le 21 Fév 2024
assert(~any(strcmp(columnhinge1H2,'B to C')),'Structure collapsed')
  2 commentaires
Arif
Arif le 23 Fév 2024
thanks bud
Voss
Voss le 23 Fév 2024
right on

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Data Types dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by