필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
Stephen
Stephen 2011년 8월 15일
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
Kaustubha Govind
Kaustubha Govind 2011년 8월 15일
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.

댓글을 달려면 로그인하십시오.

답변 (2개)

Stephen
Stephen 2011년 8월 15일
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 2011년 8월 20일
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]

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by