How to find all the intersections of two lines.

10 ビュー (過去 30 日間)
John
John 2014 年 10 月 21 日
回答済み: John 2014 年 10 月 21 日
I've written a code to plot two equations but I'm trying to find the value of my variable t where the two equations intersect at the nine points. Does anyone know how I would tell matlab to find the solution at these nine points. The following is my code
>> a=20*10^(-6);
n1=1.455;
n2=1.440;
lambda=900*10^(-9);
k=2*pi/lambda;
k1=k*n1;
syms t;
phim=2*a*k1*cos(t);
eqls=tan(0.5*phim);
eqrs=sqrt(sin(t)^2-(n2/n1)^2)/cos(t);
hold on
ezplot(eqrs,[81.75*pi/180,pi/2])
ezplot(eqls,[81.75*pi/180,pi/2])
ylim([0,10])

回答 (1 件)

John
John 2014 年 10 月 21 日
Nevermind just figured it out using
eq=eqrs-eqls; vpasolve(eq,t,init_guess)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by