for loop produces a 103x1 array I need a 1x103 array.
Show older comments
How do I get this for loop to produce a 103X1 array? I do not want to use the transpose function.
for ii = 1:numel(H)
if H(ii) <= 11
P_S(ii) = (101.325)*((288.15/(STemp_K(ii)))^-5.255877);
elseif H(ii) >= 11 && H(ii) <= 20
P_S(ii) = (22.632)^(-0.1577*(H(ii)-11));
elseif H(ii) >= 20 && H(ii) <=32
P_S(ii) = (5.4749)*((216.65/(STemp_K(ii)))^34.16319);
elseif H(ii) >= 32 && H(ii) <=47
P_S(ii) = (0.868)*((228.65/(STemp_K(ii)))^12.2011);
elseif H(ii) >= 47 && H(ii) <=51
P_S(ii) = (0.1109)^(-0.1262*(H(ii)-47));
end
end
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing 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!