- #1

darkxynx

- 4

- 0

This is what I have so far:

%Re=reynolds number

%p = density of the fluid

%v=mean fluid velocity

%D=diameter of the fluid

%u=fluid viscosity

function Re=viscosity(p,v,D,u)

p=input('p: ');

v=input('v: ');

D=input('D: ');

u=input('u: ');

Re=(p*v*D)/u;

if Re<2000

disp('The liquid is laminar')

elseif Re>=2000&Re<=4000

disp('The liquid is transition')

else

disp('The liquid is Turbulent')

end

However, we have to input the a chart of data, running the function only once. I did some researching and I could not find any examples. If anyone could point me in the right direction, I'd really appreciate it. My next attempt would be to somehow use index and for loop.

The chart of data we have is a 3x4.

On a side note, anyone know any good resources for coding with matlab?

Thanks!