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

1 回表示 (過去 30 日間)
Arif
Arif 2024 年 2 月 21 日
コメント済み: Voss 2024 年 2 月 23 日
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"

採用された回答

Voss
Voss 2024 年 2 月 21 日
assert(~any(strcmp(columnhinge1H2,'B to C')),'Structure collapsed')
  2 件のコメント
Arif
Arif 2024 年 2 月 23 日
thanks bud
Voss
Voss 2024 年 2 月 23 日
right on

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by