how to plot graph for U wrt L_lime from 0.001 to 0.003 with differance 0.001? getting error using / matrix dimension must agree. the value of L_lime changes U value
2 views (last 30 days)
Show older comments
di=0.01;
do=0.025;
hi=5000;
m_dot = 0.3;
k= 0.598;
rho=998;
knew=1.004*10^-6;
pr=7.01;
dh=do-di
Ac = pi*((do^2)-(di^2))/4
vel=m_dot/(rho*Ac)
Re=(vel*dh)/knew
if Re>4000
Nu=0.023*(Re^0.8)*(pr^0.4)
end
ho= (k*Nu)/dh
k_lime=1.3;
L_lime = [0.001:0.003:0.0001];
U=(1/((1/hi)+(L_lime/k_lime)+(1/ho)))
0 Comments
Accepted Answer
Diwakar Diwakar
on 5 Jun 2023
To perform the division between L_lime and k_lime, you need to ensure that their dimensions match. If you want to divide each element of L_lime by k_lime, you can use element-wise division by adding a dot before the slash operator.
Try this code:
di = 0.01;
do = 0.025;
hi = 5000;
m_dot = 0.3;
k = 0.598;
rho = 998;
knew = 1.004 * 10^-6;
pr = 7.01;
dh = do - di;
Ac = pi * ((do^2) - (di^2)) / 4;
vel = m_dot / (rho * Ac);
Re = (vel * dh) / knew;
if Re > 4000
Nu = 0.023 * (Re^0.8) * (pr^0.4);
else
Nu = 0; % Set Nu to zero if Re is not greater than 4000
end
ho = (k * Nu) / dh;
k_lime = 1.3;
L_lime = 0.001:0.003:0.0001;
U = (1 ./ ((1 ./ hi) + (L_lime ./ k_lime) + (1 ./ ho)));
More Answers (0)
See Also
Categories
Find more on Line Plots 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!