フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

MATLAB Function Interface Error: Domain error. To compute complex results, make at least one input complex, e.g. 'power(complex(a),b)'.

1 回表示 (過去 30 日間)
hi, how can i resolve this error?: Domain error. To compute complex results, make at least one input complex, e.g. 'power(complex(a),b)'. the error seems to be the program line:
h2=(4*sin(el)^2*(G - F*(F^2 + G^2 - 1)^(1/2))^2*(1 + (F^2 + G^2 - 1)^(1/2)*1i)^2)/((F*1i - G)^2*(F^2 + G^2)^2);
h3=(8*sin(el)*(G - F*(F^2 + G^2 - 1)^(1/2))*(1 + (F^2 + G^2 - 1)^(1/2)*1i)^2)/((F*1i - G)^2*(F^2 + G^2));
h4=(sin(el)*(1 + (F^2 + G^2 - 1)^(1/2)*1i)^2*1i)/(F*1i - G)^2;
a=-log(((F^2 + G^2)^2*(h1*1i + (2*(1 + (F^2 + G^2 - 1)^(1/2)*1i)*1i)/(F*1i - G) - ((4*(1 + (F^2 + G^2 - 1)^(1/2) * 1i)^2)/(F*1i - G)^2 + X2^2 + X3^2 - (2*X2^2*(1 + (F^2 + G^2 - 1)^(1/2)*1i)^2)/(F*1i - G)^2 +(X2^2*(1 + (F^2 + G^2 - 1)^(1/2)*1i)^4)/(F*1i - G)^4 - (2*X3^2*(1 + (F^2 + G^2 - 1)^(1/2)*1i)^2)/(F*1i - G)^2 + (X3^2*(1 + (F^2 + G^2 - 1)^(1/2)*1i)^4)/(F*1i - G)^4 + h2 - h3)^(1/2)*1i + h4))/(2*(G + F*1i)^2*(X2 - X3*1i)*(1 - G^2 + F*G*1i + (F^2 + G^2 - 1)^(1/2)*1i)))*1i;
  3 件のコメント
studentU
studentU 2015 年 5 月 21 日
[I am confused now. Is this in Simulink or is this at the MATLAB command prompt? If it is at the MATLAB command prompt, then I need to a current copy of the line that failed and I need to know the values it fails on -- a sample el, F, G] by Roberson
At the command prompt it's run very well, I remember u that F and G are scalar numeric values, you can take to F = -0, 883, and G = 0.0987, the result is complex format.
but, I'm working in simulink, in matlab function block, where I am blocked, and where it generates this error :/
studentU
studentU 2015 年 5 月 21 日
i think, the solution is to introduce complex() in the h2, h3 h4 and a expressions,
but I can not do it

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by