error bars on plot
Show older comments
Hello. I am having trouble adding error bars to this plot. My code is below. I need the data "cd_water, re_water..cd_glycol, re_glycol...etc.." all to show error bars from the original loglog plot of CD vs Re. please help. thank you.
Re = logspace(-2,7,1001);
term1 = (24./Re);
term2 = ((2.6*(Re./5))./(1+((Re./5).^1.52)));
term3 = ((0.411*((Re./263000).^(-7.94)))./(1+((Re./263000).^(-8))));
term4 = ((Re.^(0.8))./461000);
CD = term1 + term2 + term3 + term4;
figure(2)
loglog(Re,CD)
grid on
xlabel('Re');ylabel('C_D');
hold on
Cd_water = [0.381, .324, 0.297, 0.214, 0.321];
Re_water = [70221.78, 41366.93,166202.97, 101691.09, 34306.93];
Cd_glycol = [.602,.757,.324,.402,.975];
Re_glycol = [3672.43,1720.25,10375.76,4843.64,1230.25];
Cd_glycerin = [45.4,130,11.4,33.1];
Re_glycerin = [12.89,4.13,57.19,17.47];
plot(Re_water,Cd_water,'*',Re_glycol,Cd_glycol,'.',Re_glycerin,Cd_glycerin,'o')
legend('Expected','Water','Glycol','Glycerin')
Accepted Answer
More Answers (0)
Categories
Find more on Errorbars 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!