MATLAB: How to Create a mat file for images

how to create a mat file for images converted to 1xn in double va;ues

i have 15 images say x1=[1 2
3 4 ]
similarly x2 =[5 6
3 4 ] , x3 till x15
first i want these to be converted to x1= [ 1
2
3
4]
similarly other matrixes also.
i want to save a mat file called
dark = [ 1 6
2 7
3 3
4 4]

Best Answer

A mat file called what?
Anyway, to save those variables:
save(matFileName, 'x1', 'x2, 'x3', 'x4', ...
'x5', 'x6', 'x7', 'x8', ...
'x9', 'x10', 'x11', 'x12', ...
'x13', 'x14', 'x15', 'dark');