How do I solve $0 = x\times114 - x\times\log_3(x) - 20.28\times y$ in matlab for different values of $y$?

62 Views Asked by At

I have $y = 10^3, 10^6, 10^9, 10^{12}, 10^{15}, ...$ and above mentioned equation. How do I solve (i.e. getting values of x for different y) and plot this equation in MATLAB ?

1

There are 1 best solutions below

2
On BEST ANSWER

For finding zeros you can use fzero, you just have to use a starting value $x_0$.

x0 = 10;

y=10^3;

f = @(x) 114*x-log(abs(x))/log(3) .* x - 20.28*y;

fzero(f,x0);

You then have to check whether the solution is greater than $0$ because we used $log(|x|)$.

For implicit plots (as you seemed to ask first) you can use following functions: You can use the contour function for implicit plots: Just provide a nullvector as levels. Other functions for implicit plots are implot, implot2, and ezplot.