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

조회 수: 3 (최근 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')

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by