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

1 次查看(过去 30 天)
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;

采纳的回答

Star Strider
Star Strider 2017-1-10
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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by