MATLAB: How to find a real positive root fsolverootsolve How to find only the positive root of the equation x^3-A=0 for each A where A is a parameter varying like 1,2,3,….1000. If alpha is the root, find the value of alpha/(alpha +1) for each case. Best Answer hi, try this essay : counter=1; for A=1:100 f=@(x) x^3-A; alpha=fzero(f,A); if isa(alpha,'complex'); continue; else X(counter)=alpha; Y(counter)=alpha/(alpha+1); counter=counter+1; end end figure, plot(Y); Related SolutionsMATLAB: Solve an expression and plot beta = 0.85; gamma = .15; theta = 0.1;alpha = .303: .001: 5;syms Alpha deltaA = -Alpha * beta + Alpha .* delta + gamma * beta + beta;B = Alpha .* theta * (beta - delta) + gamma * beta;rr = solve( A^2 - 4*B*beta, delta);rrt = double(subs(rr, Alpha, alpha(1));[maxrrt, idx] = max(rrt);maxrr = rr(idx);rrpos = double(subs(maxrr, Alpha, alpha));plot(alpha, rrpos) MATLAB: How to plot this implicit function Try symbolic expressionclc,clearalpha=1.5; A=0.0207; gamma=0.25;syms beta epsx = (beta-alpha*(beta-gamma)+sqrt((beta-alpha*(beta-gamma)).^2+4*alpha*beta*gamma*A))./(2*beta);y = x.*(1-x).*beta/gamma;t = -x+x.*y.*(alpha-eps*beta)./((A+x+y).^2);d = eps*beta.*x.*y.*(x.^2+(A+x).*x+A*alpha)./((A+x+y).^3); % convert symbolic expression to function handleF = matlabFunction(t.^2 - d,'vars',[beta eps]);ezplot(F,[0,1,0,1]); Related Question
Best Answer