Any help hot I can plot this. It keeps running

Re=(4000:400000);
f1=zeros(1,400000);
f2=zeros(1,400000);
f3=zeros(1,400000);
k=1;
for n=1:400000;
f1(k)=DarcyFricFact(0.01,2,Re(k));
f2(k)=DarcyFricFact(0.01,5,Re(k));
f3(k)=DarcyFricFact(0.01,5,Re(k));
end
plot(Re,f1,Re,f2,Re,f3)
title('Friction Factor vs Reynold number')
xlabel('Reynumber')
ylabel('Friction Factor')

 Accepted Answer

Well, since we are not privy to your code DarcyFricFact, how do you expect an intelligent answer?
Is that code efficient? Is there a good reason why you feel you need to evaluate it at 400000 points just to create a plot? (Hint, your eye cannot distinguish that many points on the screen, and the pixels on your computer screen are too big.)

More Answers (1)

I know you already accepted an answer and so have solved your problem, but for future reference, here is the answer to most all of your questions: this link. With that, you could have solved that problem, plus most any others that popup in the future.

Categories

Products

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!