How can I save three dimensional matrix into a .dat or .txt file?

7 views (last 30 days)
Hi there,
I got 1x5x5 matrix(attachement A) which represent data values of 25 location of a regular grid.
I need to save this matrix into .dat or .txt file with the heading lines of x coordinate and y coordinate. See the folowing format.
Y1 Y2 Y3 ....
X1 value1x1 value 1x2 value1x3 ....
X2 value2x1 value 2x2 value2x3 ....
X3 value3x1 value 3x2 value 3x3 ....
....
In addition, there is 2x5x5 (attachement B) matrix which represent minimum and maximum values for each coordinates to be save in follwing format.
Y1 Y2 Y3 ....
X1 min_value1x1 min_value1x2 min_value1x3 ....
max_value1x1 max_value1x2 max_value1x3 ....
X2 min_value2x1 min_value2x2 min_value2x3 ....
max_value2x1 max_value2x2 max_value2x3 ....
...............
Can anyone please help me to do that?
Thank you

Answers (1)

madhan ravi
madhan ravi on 8 Dec 2018
Edited: madhan ravi on 8 Dec 2018

Categories

Find more on MATLAB 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!