Merging files with different dimensions
Info
This question is closed. Reopen it to edit or answer.
Show older comments
Hi guys. I am quite new in Matlab and I have the following problem. Hope its not too stupid.. i have three different files. The first one contains the x value (10x6480), the second y (10x6480), the third T (10x213840). T is organised in loops and describes the temperatures for different water depths(33 in total):
0,10,20,30,50,75,100,125,150,200,250,300,400,500,600,700,800,900,1000,1100,1200,1300,1400,1500,1750,2000,2500,3000,35000,4000,4500,5000,5500
Accordingly, the first 10x6480 values in T describe the temperature distribution for depth level '0' with the coordinates from x and y. The next 10x6480 T values describe the temperature distribution for depth level '10' again with the coordinates from etc. What I would like to have is a file comprising x-y-depth-T.
x1-y1-depth1-T1
x2-y2-depth1-T2
x3-y3-depth1-T3
....
x1-y1-depth2-T64801
x2-y2-depth2-T64802
...
x1-y1-depth3-T129601
x2-y2-depth3-T129602
etc..
From my beginner skills, I would try to reshape the files into single column files. Then, I would copy x and y 33 times so that they have the same dimension as T. In the same way I would organise also the depth file so that I can merge at the end 4 different files with the same dimension. This 'solution' appears quite unsexy and I am sure that matlab is able to solve the problem with loops, somehow. I would be very happy for any help or link. :) Thanks a lot! P
2 Comments
Azzi Abdelmalek
on 22 Jul 2015
Can you explain what is x1-y1-depth1-T1, their sizes?
Answers (2)
This question is closed.
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!