How to find all the intersections of two lines.

10 vues (au cours des 30 derniers jours)
John
John le 21 Oct 2014
Réponse apportée : John le 21 Oct 2014
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])

Réponses (1)

John
John le 21 Oct 2014
Nevermind just figured it out using
eq=eqrs-eqls; vpasolve(eq,t,init_guess)

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by