Inserting value to a database not working...
14 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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?
0 comentarios
Respuesta aceptada
Walter Roberson
el 3 de Abr. de 2013
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.
Más respuestas (0)
Ver también
Categorías
Más información sobre Database Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!