how could i sub in the y value to find the x value for the function

2 views (last 30 days)
k1=0.000358;
k2=0.000158;
ca0=4.89;
x=1:10000;
f = @(x) 0.000358.*4.89.*x./(1+0.000358.*x+0.000158.*x+0.000158*0.000358*x.^2);
g = @(x) 4.89./(1+0.000385.*x);
h = @(x) 4.89.*0.000358.*0.000158.*x.^2/(1+0.000358.*x+0.000158.*x+0.000158.*0.000358*x.^2);
[i,m] = max(f(x))
plot(x,f(x),x,g(x),x,h(x))
legend('cb','ca')
i found the max value i just want to sub it back to the equation to find the x value

Answers (1)

VBBV
VBBV on 26 Oct 2021
k1=0.000358;
k2=0.000158;
ca0=4.89;
x=1:10000;
f = @(x) 0.000358.*4.89.*x./(1+0.000358.*x+0.000158.*x+0.000158*0.000358*x.^2);
g = @(x) 4.89./(1+0.000385.*x);
h = @(x) 4.89.*0.000358.*0.000158.*x.^2/(1+0.000358.*x+0.000158.*x+0.000158.*0.000358*x.^2);
[i,m] = max(f(x));
plot(x,f(x),x,g(x),x,h(x));
legend('cb','ca')
x(m)
ans = 4205

Categories

Find more on Programming in Help Center and File Exchange

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!