Operands to the || and && operators must be convertible to logical scalar values.
Afficher commentaires plus anciens
Dear All The code that I am working with is separated to sections with function command. After running the code with input parameters this error occurs. (Operands to the and && operators must be convertible to logical scalar values) However, when I insert the values of the parameters inside the code, then running it , I found it is running. I don't want to insert the parameters values in the code directly ,I want to feed the parameters as input as follow: WaRa(1, 9.81, 0.017, 0, 8.8, 15.2, 1, 1, 0, 0, 2, 4, 0, 36.9, 15.2) any suggestion please?
2 commentaires
sailaja
le 9 Mai 2025
Operands to the logical AND (&&) and OR (||) operators must be convertible to logical
scalar values. Use the ANY or ALL functions to reduce operands to logical scalar
values.
Error in defcx (line 50)
if klb<=0 || klb>max(LMI_var(1,:)),
Error in minrao (line 105)
[Q_valj, Qbar_valj,eps_valj,eps_bar_valj] = defcx(lmis, j, Q_val, Qbar_val,eps_val, eps_bar_val);
Walter Roberson
le 9 Mai 2025
Modifié(e) : Walter Roberson
le 9 Mai 2025
klb might be empty, or non-scalar. In turn one of the "val" variables might be empty or non-scalar
Réponse acceptée
Plus de réponses (1)
Bestun
le 18 Avr 2012
0 votes
Catégories
En savoir plus sur Logical (Boolean) Operations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!