To compute complex results from real x, use 'sqrt(complex(x))

50 ビュー (過去 30 日間)
Prateek Tiwari
Prateek Tiwari 2020 年 5 月 29 日
回答済み: Sahithi Kanumarlapudi 2020 年 6 月 1 日
A= [exp(sqrt(-w1/w2)*t) , exp(-sqrt(-w1/w2)*t) ]
I have this matrix with w1,w2 as contant and t is the time update every instance in simulink.
When I run the simulink, I am getting the error "Domain error: To compute complex results from real x, use 'sqrt(complex(x))". I tried looking for thr help, did not get the answer correctly. I understand from one of the answers that it is because the range limit is exceeded than expected. However I coulnot find the solution to solve my issue. Can anyone help me in this.

採用された回答

Sahithi Kanumarlapudi
Sahithi Kanumarlapudi 2020 年 6 月 1 日
Hi,
Passing a negative value to the 'sqrt' function might be the reason for this error.
Refer to the last paragraph of the answer posted at the following link.
Your issue is not related to Matlab coder, But the reason might be the same.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeneral Applications についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by