I have an excel file that I imported into MatLab using xlsre
I have an excel file that I imported into MatLab using xlsread....
this file has numbers ranging from 1000-5999 and has over 5000 individual elements in it
The basics of the question is that all odd numbers are men and even numbers are women.... I am having a hard time with the commands to separate the men(odds) and women(evens)
The output must look something similiar to this(with different numbers):
The total # of habitants in Tiny Ville is = 10
Tiny Ville has = 8 women
Tiny Ville has = 2 men
Can someone show the correct matlab script!!
Solution
exlSheet1 = exlFile.Sheets.Item(\'Sheet1\'); robj = exlSheet1.Columns.End(4); % Find the end of the column numrows = robj.row; % And determine what row it is dat_range = [\'A1:G\' num2str(numrows)]; % Read to the last row rngObj = exlSheet1.Range(dat_range); exlData = rngObj.Value; for ii = 1:size(exlData,2) if(i % 2) == 0) fe=fe+1 else ma=ma+1 end if end