Put multiple loglog plots on one figure

13 visualizaciones (últimos 30 días)
Josh Glenn
Josh Glenn el 31 de Oct. de 2018
Editada: madhan ravi el 31 de Oct. de 2018
Hello...I am trying to put 3 loglog plots on the same figure but this is not working. Any recommendations or small things I'm missing?
Thanks! :)
clear
clc
close all
format short
Re = 10^4:1000:10^8;
%Bruus
B = @(x) .25*(log((x/3.7)+(5.74./(Re).^.9)));
%Haaland
H = @(x) (1./(-1.8*log((x/3.7)^1.11+(6.9./Re)))).^2;
%Figure 1
eD1 = 0;
B1 = B(eD1);
H1 = H(eD1);
figure;
loglog(Re,B1,'r')
hold on
loglog(Re,H1,'--')
title('f vs. Re e/D = 0');
xlabel('Re');
ylabel('f');
legend('Bruus','Haaland');
grid on

Respuestas (1)

madhan ravi
madhan ravi el 31 de Oct. de 2018
Isn’t this normal? because the domain of the log function starts from 0+ to wards positive infinity that’s why it’s ignoring negative arguments.
  5 comentarios
Josh Glenn
Josh Glenn el 31 de Oct. de 2018
okay so it should put them on the same graph? even when the mathematical error is fixed it still only puts one on the log scale graph. Is there something small I'm missing?
madhan ravi
madhan ravi el 31 de Oct. de 2018
It should plot all the graphs if you fix the mathematical error.

Iniciar sesión para comentar.

Categorías

Más información sobre General Applications en Help Center y File Exchange.

Productos


Versión

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by