Converting 3 matrix to X Y Z type file

3 views (last 30 days)
David McCracken
David McCracken on 11 Aug 2019
Commented: Steven Lord on 11 Aug 2019
I have 3 matrix (Lat, Long, WS) in the following format
Lat : 50 51 52
Long: 1.0 1.1 1.2
WS: 9.0 9.2 9.8
i would like to combine these matrix such that the outout is as follow
out:
50 1.0 9.0
51 1.1 9.2
52 1.2 9.8
can anybody help how i may go about this please?
Thanks

Answers (1)

Steven Lord
Steven Lord on 11 Aug 2019
Transpose them and concatenate them as shown in the Concatenating Matrices section on this documentation page. Alternately, if you want to be able to refer to each column by name (Lat, Long, WS) create a table using those vectors.
  2 Comments
David McCracken
David McCracken on 11 Aug 2019
I think i over simplified the example . Each matrix is a 21 x 15 so transposing i dont think would work
so from the three matrix is want all the numebr in cell 1,1 together as above and all the numbers in 2,1 etc
Steven Lord
Steven Lord on 11 Aug 2019
In that case, reshape your matrices into vectors first.

Sign in to comment.

Categories

Find more on Matrices and Arrays in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!