Help with code please?
Show older comments
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!
Accepted Answer
More Answers (0)
Categories
Find more on Whos in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!