フィルターのクリア

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 Center および File ExchangeEvent Functions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by