how to combine three variables from two different .mat files
1 view (last 30 days)
Show older comments
Hello I have two .mat files each containing data that I need to combine and extract. My "grid".mat file has two variables, Y and X, each in the dimensions of my grid.
Y =
2 2 2 (new line)
1 1 1 (new line)
0 0 0
X =
4 3 2 (new line)
4 3 2 (new line)
4 3 2
Combined they make up my "base" grid
A second .mat file contains my data that I need to work with - with individual values for each grid cell.
How do i combined these data into something I can plot, manipulate, etc.?
Thank in advance for any suggestions.
2 Comments
Stephen23
on 13 Aug 2018
@Kristian Kjeldsen: what have you tried so far? Are you having problems loading the data, or joining it together somehow? So far your question gives no useful information about how the "second" data are arranged or formatted: are they also numeric data, arranged in the same grid?
It would help if you uploaded sample files by clicking the paperclip button.
Answers (1)
Stephen23
on 13 Aug 2018
Probably all you need is something like this:
S = load('grid.mat');
T = load('second.mat');
X = S.X;
Y = S.Y;
Z = T.whateverthenameofthedatais
surf(X,Y,Z)
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!