Reading Excel files and creating an array in MATLAB -


i have software coordinates exported xls file, want create function within matlab uses xls file not wish change original software (therefore xls file have remain in same format).

i using code

file = 'ken file2.xls'; [num,txt,raw]=xlsread(file); xarray = cell2mat(raw(:,1)) yarray = cell2mat(raw(:,2)) 

which not enough excel file following:

 1     2  2     2.1  3     2.2    4     2.3    value of ken   27 

because of text in column code falls over, can manually edit excel file above code works rather have code handles this.

any ideas?

you find cut off cell array using ismember:

%//example data = {'1';'2';'3';'4';'';'value'};  last = find(ismember(a,''),1)-1; a_new = a(a:last); 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -