フィルターのクリア

Why does fzero returns initial guess.

2 ビュー (過去 30 日間)
Eric Daiber
Eric Daiber 2016 年 9 月 26 日
回答済み: Star Strider 2016 年 9 月 26 日
My script is below, whenever I enter this script into Matlab it returns to me my initial guess. I am curious Why? All help appreciated.
q = 10
theta = 135
Q = 600
z = 20
P = @(x,y) q*sin(theta)*x - q*cos(theta)*y - Q./(2*pi*z)*atan((x./y));
D = []
for x = -10:10;
for y = -10:10;
E= P(x,y);
D = [D;E,x,y];
end
end
%to check if the equation T (psi) works for root finding equation
T = @(x,y) q*sin(theta)*x - q*cos(theta)*y - Q./(2*pi*z)*atan((x./y))-P(x,y);
L = [];
for x = -10:10;
for y = -10:10;
Q=T(x,y);
L = [L;Q];
end
end
R=[]
x = [];
for y = -5:5;
[yi]= fzero(@(x) T(x,y),25);
x=[x;yi,y]
end

採用された回答

Star Strider
Star Strider 2016 年 9 月 26 日
Your ‘T’ function is for all intents and purposes ‘P(x,y)-P(x,y)’. The fzero function detects zero-crossings, and ‘T’ is zero everywhere:
P = @(x,y) q*sin(theta)*x - q*cos(theta)*y - Q./(2*pi*z)*atan((x./y));
T = @(x,y) q*sin(theta)*x - q*cos(theta)*y - Q./(2*pi*z)*atan((x./y))-P(x,y);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFunction Creation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by