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 CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by