when I run my simulink model the error found is "Domain error. To compte complex results from real x, use 'log(complex(x))'." im having a function block in my model. my license no is 1119172

6 ビュー (過去 30 日間)

回答 (1 件)

Chidvi Modala
Chidvi Modala 2020 年 1 月 2 日
I am assuming that you are providing a negative value as input to log function in your code. If you supply a value less than zero to a log function, you will get a complex number. Simulink might be complaining about that in your code inside the function block.
You can limit the value of the output or input as shown below to avoid the error
logvalue = min(log(X),eps) % Replace X with your variable
If above is not the case, providing your Simulink model or the code inside function block might be helpful

カテゴリ

Help Center および File ExchangeSimulink Functions についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by