The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Importing & Exporting
Replies: 1   Last Post: Nov 11, 2012 5:09 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 1
Registered: 11/11/12
Importing & Exporting
Posted: Nov 11, 2012 1:57 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

% I have to import images from 40 classes (directories) and each directory
% has 7 images which is i called as subjects. then i need to make a vector
% form of each image and then save it into linear array.
% note my pictures is in grayscale which i will need to be in a linear
% array.
% Below I have written the code but it is giving me following error
%??? Error using ==> imread at 374
%File "d:/ahsan/biometrics/imagedatabase/ATT/s1/1.PGM" does not exist.

%Error in ==> Pr4 at 15
%filename = imread(

%start program
clear all ;

class = 40 ; % We have 40 folders in our main directory.
subjects = 7; % we have 7 images in our single directory.

for i = 1:class % this loop traverse all directories
for k = 1:subjects % this loop traverse images in single directory
filename = imread( sprintf('d:/ahsan/biometrics/imagedatabase/ATT/s%d/%d.PGM',i,k));
image = importdata (filename, '.PGM');
Y = ones(1,10); %Column array
Y1 = filename;
Y1= reshape(myfilename,1,[]);
%end program

Date Subject Author
Read Importing & Exporting
Read Re: Importing & Exporting

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.