Effacer les filtres
Effacer les filtres

Simple fnc model has error message about || and && operators

1 vue (au cours des 30 derniers jours)
Stephen
Stephen le 15 Août 2011
I get the following error message when I update a model
"Operands to the '||' and && operators must be convertible to logical scalar values."
The fnc is a simple fnc block, that takes two scalar double inputs, u(1) and u(2), and performs a math operation on them and then outputs the result to one outport block. The inputs come from two inport blocks that are followed by a mux.
What does '||' and && have to do with this? Is that part of the mux block, under the hood? If so, is a selector block needed after the mux and before the input to the simple fnc block?
  1 commentaire
Kaustubha Govind
Kaustubha Govind le 15 Août 2011
The error looks like it could be coming from your Fcn block. Try executing "dbstop if all error" at the MATLAB prompt before updating your model to see if MATLAB breaks in the function that the error occurs at.

Connectez-vous pour commenter.

Réponses (2)

Stephen
Stephen le 15 Août 2011
Thanks, Kaustubha.
I tried your suggestion (dbstop if all error) and got the following error message:
Error using ==> getPowerguiInfo at 67.
But the model does not include a powergui block. The model is a subsystem of another model that does not include a powergui block either. However, that parent model is then part of a model that does use a powergui block. Is it possible that when a model is updated, somehow other models can affect that update?

Fangjun Jiang
Fangjun Jiang le 20 Août 2011
There is a difference between && and &. && applies to scalar and & applies to vector. Try the following one at a time to see the difference. Your input might not be a scalar as you expected.
1.2 && 3.5
[1 2] & [3 4]
[1 2] && [3 4]

Catégories

En savoir plus sur Event Functions dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by