Help with code please?
Afficher commentaires plus anciens
Hello all, I have the following attempt...
clc
clear
Re=linspace(2300,40000,100);
ed=0.058887;
relr=ed;
dfTol=5e-6;
ft= (1./(-1.8*log10(((ed/3.7)^1.11)+(6.9./Re)))).^2;
for ii=ft;
jj=Re;
cole=@(f,ed,Re) 1/sqrt(f)+2*log10((ed/3.7)...
+(2.51./Re*sqrt(f)));
f(ii) = fzero(cole,ii,optimset('TolX',dfTol,'Display','off'),relr,Re);
end
plot(fric)
I want to find the value of 'f' at each value in 'Re' and plot this against 'Re'. I am using 'ft' as the estimation point for fzero and am not sure how to get this to work. I apologize if my coding is terrible, I am a beginner at matlab and am not very good. Any help would be much appreciated. Thanks!
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Whos 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!