domain error. to compute complex results from real x, use 'log(complex(x))'
2 ビュー (過去 30 日間)
古いコメントを表示
hello, I'm having trouble with the domain error. to compute complex results from real x, use 'log(complex(x))' on my project fuel cell. how to handle it?
0 件のコメント
回答 (1 件)
Walter Roberson
2023 年 7 月 9 日
At some point your x becomes negative. MATLAB proper would handle the situation by creating a complex result, but Simulink generates an error message because such situations in Simulink often result from an incorrect model or omission in thinking about the model
2 件のコメント
Walter Roberson
2023 年 7 月 10 日
When your x goes negative what results would you want from the log()? If you want the log of the absolute value of x then code the log of the absolute value of x.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!