フィルターのクリア

Error : The first argument of the 'verify' operator must be a scalar logical expression.

21 ビュー (過去 30 日間)
MahaboobKamal
MahaboobKamal 2024 年 7 月 2 日 16:38
コメント済み: Walter Roberson 2024 年 7 月 2 日 18:32
I am getting the error (Error : The first argument of the 'verify' operator must be a scalar logical expression.) in Testsequence (Simulink Test) while performing the MIL testing.
The Output signal "TGS_Zero_Pos_EE_NVM" is an output with array of[4x1].
Currently i have added as below :
Step_1
verify(TGS_Zero_Pos_EE_NVM == single([1.5; 1.5; 1.5; 1.5]))
Error : The first argument of the 'verify' operator must be a scalar logical expression.
Please suggest how can i add the Output signal "TGS_Zero_Pos_EE_NVM" in Testsequence inorder to run the Testsequence.
The inputs i am using are :
NVMUpdatesZeroLearn_b = [0; 0; 0; 0]; %this is an array[4x1] input
NVMsZeroLearnArray = true;
Ignition_Is_Off = false;
Engine_Is_Running = false;
Reset = false;
V5B1_Out_Of_Range = false;
deltaTime = 0.001;
HAL_TGS1_AnalogIn_V = 0.7;
V5B2_Out_Of_Range = false;
HAL_TGS2_AnalogIn_V = 2;
DID_Disable_ZeroLearning = false;
NVMs_StoredMax_V = 0;
NVM_Updates_Max_b = false;

回答 (1 件)

Voss
Voss 2024 年 7 月 2 日 16:59
verify(isequal(TGS_Zero_Pos_EE_NVM,single([1.5; 1.5; 1.5; 1.5])))
  1 件のコメント
Walter Roberson
Walter Roberson 2024 年 7 月 2 日 18:32
Or
verify(all(TGS_Zero_Pos_EE_NVM == single([1.5; 1.5; 1.5; 1.5])))
but this will fail if TGS_Zero_Pos_EE_NVM is not shape-compatible with a column vector of length 4, whereas the isequal() approach handles the situation nicely and so is better.

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

カテゴリ

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

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by