fzero for a loop of functions
Afficher commentaires plus anciens
What I'm trying to do is frustratingly simple. I'm trying to use the fzero function to find a root for the function below, at each value of "n" from 1 to 25. I'm currently running fzero for the function below, then manually changing the value of "n" to 2, saving the .m file, fzero'ing again, and so forth. I'm looking for a cleaner way to do this.
*As a tidbit of extra information that may be relevant, fzero only works when given an input of at least 46 in the form "fzero(@TerminalV,46). anything below that returns a "NaN".
function fx = TerminalV(v)
A = pi()*(0.15)^2/4;
T = [213.15:5:333.15];
for n=1;
fx = 9.8*0.5*2./(Density(T(n)).*A)-(v.^2).*(24./((Density(T(n)).*v.*0.15)./viscosity(T(n)))...;
+6./(1+(Density(T(n)).*v.*0.15./viscosity(T(n))).^0.5)+0.04);
end
end
4 commentaires
madhan ravi
le 6 Mar 2019
Density, Viscosity, v?
Filip Jackowski
le 6 Mar 2019
Modifié(e) : Filip Jackowski
le 6 Mar 2019
madhan ravi
le 6 Mar 2019
T?
Filip Jackowski
le 6 Mar 2019
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur MATLAB 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!