how to Create a mat file for images

1 次查看(过去 30 天)
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]

采纳的回答

Image Analyst
Image Analyst 2015-4-10
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');
  4 个评论
Sharen H
Sharen H 2015-4-12
my data is i have 15 images of size mxn which has to be converted to 1 x m*n matrix .
then i have to save these in the form of mat file having 15 x m*n matrix. can u
help me to do this in way where i have to call and save using loop because my data
gets increases as it goes on. thanks in advance
Image Analyst
Image Analyst 2015-4-12
Try this:
x1 = x1(:); % Convert to 1-D
x2 = x2(:); % Convert to 1-D
... etc.
x15 = x15(:); % Convert to 1-D
dark = dark(:); % Convert to 1-D
% Now save them all into a single mat file.
save(matFileName, 'x1', 'x2, 'x3', 'x4', ...
'x5', 'x6', 'x7', 'x8', ...
'x9', 'x10', 'x11', 'x12', ...
'x13', 'x14', 'x15', 'dark');

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Convert Image Type 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by