Wednesday, January 18, 2012

MATLAB read or list all files from folder directory


dirName = '../features/movingwindowFeature/';
pattern = '/*.map' ;
fnames = dir(fullfile(dirName, pattern));
numfids = length(fnames);

all=[];

for K = 1:numfids
    pathName = strcat(dirName,fnames(K).name);
    display(fnames(K).name);
    all = [ all load( pathName ) ] ;

end

Monday, January 16, 2012

MATLAB HANDLING TEST DATA FILE


fid = fopen('D:\eclipseWorkspace\SNPAanlysis\snpSelectedInfoP.txt');
mydata = textscan(fid, '%s %s %s %s  %s %s  %s %s ');




mydata{1} ; % 1ST COLUMN
unique(mydata{1} ) % UNIQUE in 1st column

char(unique(mydata{1} ) ) % convert to character

fclose(fid);