MATLAB: Creating a *.mat file

.mat file

Hello, I want to create a *.mat file, for example named bathymetry. This array called bathymetry I want to be formed by 3 other arrays, for example, x, y and z. In a way, that when I charged the mat file it transforms into three files called x, y and z.
I've tried my easy way: for example: bathymetry=[x,y,z], but when I charged it, it's only 1 file called bathymetry and I want to have them separetely.
Please help me.

Best Answer

X=10
Y=20
Z=30
save bathymetry X Y Z
To load your data
load bathymetry