salut merci les gars je suis débutant en MATLAB je veux savoir comment affecter le contenu d'une requête SQL est c'est image dans data base Access à une variable pour l'afficher
mais pour moi il affiche seulement son nom
voila mon code de connexion a fichier Access gabor qui contient une table1 avec deux champs image et des
-------------------------------------------------------------------------
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| %Set preferences with setdbprefs.
setdbprefs('DataReturnFormat', 'cellarray');
setdbprefs('NullNumberRead', 'NaN');
setdbprefs('NullStringRead', 'null');
%Make connection to database. Note that the password has been omitted.
%Using ODBC driver.
conn = database('gabor', '', '');
%Read data from database.
curs = exec(conn, ['SELECT Table1.`image`'...
' FROM Table1 '...
' WHERE Table1.`des` = 147']);
curs = fetch(curs);
close(curs);
%Assign data to output variable
untitled = curs.Data;
imshow(untitled);
%Close database connection.
close(conn);
%Clear variables
clear curs conn |
Et le message d'erreur :
>> conxdatabase
Error using imageDisplayValidateParams
Expected input number 1, I, to be one of these types:
double, single, uint8, uint16, uint32, uint64, int8, int16, int32, int64, logical
Instead its type was cell.
Error in imageDisplayValidateParams (line 12)
validateattributes(common_args.CData, {'numeric','logical'},...
Error in imageDisplayParseInputs (line 79)
common_args = imageDisplayValidateParams(common_args);
Error in imshow (line 220)
[common_args,specific_args] = ...
Error in conxdatabase (line 21)
imshow(untitled);
>>
Partager