MATLAB: Inserting value to a database not working…

database connectioninsertnumerical value

I have the following code which works perfectly but for the 'pix' field.
My code is:
mydir = 'E:\matlab\pet_dog\';
fid=fopen('E:\matlab\ratio for pet_dog.txt','wt');
allentries = dir(mydir);
diridxs = [allentries.isdir];
alldirs = allentries(diridxs);
allfiles = allentries(~diridxs);
for ctr = 1:length(allfiles)
x = fullfile(mydir, allfiles(ctr).name);
pix = double(nnz(edge(rgb2gray(imread(x)))));
%disp(pix);
ratio = fix(9600/pix);
logintimeout(5);
con = database('fetchDB', '', '');
ping(con);
exdata = {'9600',pix,'-',ratio,x};
colnames = {'imgSize', 'imgPixel', ' imgPart','ratio','imgName'};
fastinsert(con, 'animal', colnames, exdata)
close(con);
end
Why the field 'imgPixel' is not showing the numerical values properly? What should I do?

Best Answer

Seems to me that is going to depend upon the schema you defined for the imgPixel column in the "animal" database. If it was previously defined as character, then it would stay as character until you changed the schema or deleted the database.