how to Create a mat file for images

1 vue (au cours des 30 derniers jours)
Sharen H
Sharen H le 10 Avr 2015
Commenté : Image Analyst le 12 Avr 2015
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]

Réponse acceptée

Image Analyst
Image Analyst le 10 Avr 2015
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 commentaires
Sharen H
Sharen H le 12 Avr 2015
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 le 12 Avr 2015
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');

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Convert Image Type dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by