Borrar filtros
Borrar filtros

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

1 visualización (últimos 30 días)
Stephen
Stephen el 15 de Ag. de 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 comentario
Kaustubha Govind
Kaustubha Govind el 15 de Ag. de 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.

Iniciar sesión para comentar.

Respuestas (2)

Stephen
Stephen el 15 de Ag. de 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 el 20 de Ag. de 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]

Categorías

Más información sobre Event Functions en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by