MATLAB: After i generate random numbers of x, how can i use this random x values to the rest of the code one by one. Because after that, I want to plot a friction factor-x number grapt with this different numbers

plotplottingrandom number generator

x = 0.05 + (0.1-0.05).*rand(10,1);
Perimeter = (pi*HydraulicDiameter);
NumberOfCoolantChannels = 3;
Npass = 1; ...Number of Passes
% Ac = (pi*(HydraulicDiameter^2)/(4)); ...Single channel flow cross section
Ac = 1.571e-5;
Atotal = NumberOfCoolantChannels*Ac; ... Total Flow Cross Section
BladeMassFlow = (CoolantBleed/100)*(TurbineMassFlow/NumberOfBlades);
ChannelMassFlow = (BladeMassFlow/NumberOfCoolantChannels);
RibHeighHydraulicDiameterRatio = x;
FrictionFactor2 = 1.447*(1.14-2*log10(x))^-2; %transverse ribs

Best Answer

isilay - since x is an array then you can use element-wise power to calculate the friction factor. Just change your line of code to
FrictionFactor2 = 1.447*(1.14-2*log10(x)).^-2; %transverse ribs
where a '.' is placed in front of the exponent operator.