Error using solve function
Afficher commentaires plus anciens
solve function for code
Gives the error: unable to find explicit solution.
x1 = input('Input volume of tank in gallons: ');
x2 = x1/7.48;
syms int_l;
cost = 812.745*(2*int_l.^2+4.*(int_l+0.5)*(y./(int_l.^2)+1));
diff_cost = diff(cost);
answ = solve(diff_cost == 0);
int_l = answ(isAlways(answ>0));
int_l = double(int_l);
int_h = x2/(int_l.^2);
ext_l = int_l + 1;
ext_h = x2./(int_l.^2)+1;
disp('----------------------------------------------------------------')
disp(['Length of the internal height in feet will be: ' num2str(int_l)])
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Conversion Between Symbolic and Numeric dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
