Help with code please?
显示 更早的评论
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!
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Whos 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!