for loop with fminsearch
Show older comments
%I couldnt make array values of Theta_2
u=deg2rad(13)
eqn1= @(t1, u) u+atan(sin(t1)./(1-cos(t1)))-pi/2 % theta1 t1 olarak tanımlanmıştır.
Theta_1_initial= (fminsearch(@(t1)norm(eqn1(t1, u)),u))
Theta_1=linspace(Theta_1_initial,pi/2,100)
for i=1;100
Theta_2(i)=THETA (Theta_1(i),u)
end
function [Theta_2] = THETA (Theta_1,u)
eqn=@(Theta_2,Theta_1,u) cos(Theta_2)+sin(Theta_2).*tan(pi/2-atan(sin(Theta_2)./(cos(Theta_1)+sin(Theta_1).*tan(u)-cos(Theta_2))))-cos(Theta_1)-sin(Theta_1).*tan(u);
Theta_2=fminsearch(@(Theta_2)norm(eqn(Theta_2,Theta_1,u)),Theta_1);
end
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!