MATLAB: Define a variable from an equation define a variable from an equation Hi, I have an equation with x and y are variable and a, b and d are constant. with x =[1:1:10]; How to define y variable? Best Answer As I posted in your earlier question,y1 = @(b, d, x) -b .* (exp(-(2/3) .* lambertw(-3 .* (b.^3 ./ a.^2).^(1/2) .* d.^3 ./ x.^3)) .* d.^2 - x.^2) ./ x.^2y2 = @(b, d, x) -b .* (exp(-(2/3) .* lambertw(3 .* (b.^3 ./ a.^2).^(1/2) .* d.^3 ./ x.^3)) .* d.^2 - x.^2) ./ x.^2;Now use y1(b, d, 1:10) and y2(b, d, 1:10)Note: you will need the Symbolic Toolbox for lambertw, but see also https://www.mathworks.com/matlabcentral/fileexchange/43419-the-lambert-w-function Related SolutionsMATLAB: Fitting an equation with x,y variables and b, d constant. Use lsqnonlin and define the functions f_i asf_i = 1/a*(b-ydata(i)).^1.5-log(d./xdata(i))+0.5*log(1-ydata(i)/b)Best wishesTorsten. MATLAB: How can i use Inverse for symbolic variables syms x y a b c dA = [ a*(x^2) , b*(y^3) ; d*(x^2)*y , c ];inv(A)ans =[ c/(- b*d*x^2*y^4 + a*c*x^2), -(b*y^3)/(- b*d*x^2*y^4 + a*c*x^2)][ -(d*y)/(- b*d*y^4 + a*c), a/(- b*d*y^4 + a*c)] Related QuestionIs there such a matrix operatorHow to solve a simultaneous equation of 2 variables.How Can I put some numbers in a sym and sum its cellsHow to match matrix dimensionsWhy matlab is unable to solve these set of equations
Best Answer