I am trying to use a for loop to combine columns of multiple arrays in MATLAB.
I want to take column 1 (or i) of the first variable (lat) and combine this with column 1 (or i) of the other three variables (lon, rng, and z), similar to the output expected from the code below.
if true % Example of output wanted:
test = [lat(:,1) lon(:,1) rng(:,1) z(:,1)];end
However, I want to repeat this for all 360 columns in each of the four arrays (see attached matlab file).
How would I do this with a for loop?
Best Answer