Effacer les filtres
Effacer les filtres

How do I find and display the intersection of my functions?

1 vue (au cours des 30 derniers jours)
Mo_B
Mo_B le 10 Jan 2017
Hi guys,
I want to find the intersection of y3 and y4,
x=(0:0.5:80).';
y1=(0.02049/0.4)*x;
y2=(0.53*60./(1+(1.331./(sqrt(0.0631*x./(83.18-x))).^3)));
y3=(0.53*60./(1+(1.331./(sqrt(0.0631*x./(83.18-x))).^3)))-(0.02049/0.4)*x;
y4=(0.02049/0.4)*x-(0.53*60./(1+(1.331./(sqrt(0.0631*x./(83.18-x))).^3)));
figure
plot(x,y1,'r')
hold on
plot(x,y2,'c')
plot(x,y3,'g')
plot(x,y4,'b')
legend('Line1','Line2','Line3','Line4')
axis([0 80 -1 3.5])
i tried to use
C = intersect(y3,y4)
I get C = 0, but I want the intersection near x = 70;

Réponse acceptée

Star Strider
Star Strider le 10 Jan 2017
Try this:
x = linspace(0, 80, 200);
y3 = @(x) (0.53*60./(1+(1.331./(sqrt(0.0631*x./(83.18-x))).^3)))-(0.02049/0.4)*x;
y4 = @(x) (0.02049/0.4)*x-(0.53*60./(1+(1.331./(sqrt(0.0631*x./(83.18-x))).^3)));
y34 = @(x) y3(x) - y4(x); % Subtract Functions
x0 = 40;
xi = fzero(y34, x0);
figure(1)
plot(x, y3(x), x, y4(x))
hold on
plot(xi, y3(xi), 'pr')
hold off
grid
xi =
68.8010

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots 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