An error occurred while running the simulation and the simulation was terminated Caused by: Domain error. To compute complex results from real x, use 'sqrt(complex(x))'.
5 ビュー (過去 30 日間)
古いコメントを表示
chuyen hoangcao
2020 年 12 月 30 日
コメント済み: chuyen hoangcao
2020 年 12 月 31 日
I dont know why my model has this error because in my code,i have never ust SQRT function.Hope all you help me,especially Sebastian.
0 件のコメント
採用された回答
Walter Roberson
2020 年 12 月 30 日
o =0.5;
R = anpha*sige1+beta*sige2*t;%2x1
s = dq +R;%2x1
s1 = s(1,1);
s2 = s(2,1);
sigs1 = [(s1^o)*sign(s1);(s2^o)*sign(s2)];
s1^0.5 is sqrt(s1), but your s1 or s2 are negative.
Your code already expects that they might be negative: otherwise it would not have the multiplication by sign() as it would have assumed that the sign is constant.
sigs1 = [(abs(s1)^o)*sign(s1);(abs(s2)^o)*sign(s2)];
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で MATLAB Compiler についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!