Fzero Issues with complex equation with complex roots

3 ビュー (過去 30 日間)
Jeffrey Denomme
Jeffrey Denomme 2014 年 2 月 16 日
回答済み: Paul 2014 年 2 月 16 日
I have the following code:
Zo = 50;
Zl = 10;
Bl = (0:0.01:(4*pi));
x = @(Bl)Zo*((Zl+j*Zo*tan(Bl))./(Zo+j*Zl*tan(Bl)));
[Blx,Zin] = fzero(x,[2,4]);
fprintf('\n\nValue of x is %2.3f.',Blx)
fprintf('\n\nFunction value is %2.3f.',Zin)
I get the standard error: Function values at interval endpoints must be finite and real.
I would like to identify the root located at Pi with no imaginary component. Using abs() results in NaN.
Assistance required.

採用された回答

Paul
Paul 2014 年 2 月 16 日
The value of the function at pi is 10, not 0. Do you mean you want the value where the imaginary part of the function is 0? Then you can change the function to this:
x=@(Bl)imag(Zo*((Zl+j*Zo*tan(Bl))./(Zo+j*Zl*tan(Bl))));

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOptimization Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by