It's unclear what your intentions are. If I assume you're trying to do this all elementwise WRT h, then you missed an index:
phi = acosd(h(i)/(a*(sind(38)/sind(30))));
... but if that's what you're trying to do, then you don't even need the loop at all anyway.
If instead, you're trying to calculate lac and lbc elementwise WRT h, and phi as a vector each time in the loop, then the result U cannot be a vector, but will need to be a mxm matrix.