I am trying to create a nx9 matrix by nesting a for loop in another for loop, where n is the number of iterations of the first for loop, and 9 is the number of iterations in the nested for loop. Specifically, I am iterating through different values for the NTU of a heat exchanger in the first loop, and the nested loop iterates through 9 different surface areas (A) from actual heat exchangers. The overall heat transfer coefficient is calculated for each heat exchanger for each different NTU. Here is what I have so far
i = 0;
for NTU = 2.5:0.1:3.5
i = i + 1;
eff(i) = effectiveness(NTU, c, 'One Shell Pass');
Q(i) = eff(i)*Qmax; %kW
T5(i) = Q(i)/Cmin + T4;
T14(i) = T13 – Q(i)/Cmax;
NTU_i(i) = NTU;
%Finding the overall transfer coefficient
for j = 1:9
U(j) = ((NTU*Cmin)/A(j));
end
end
Best Answer