I want to convert cursor data to String so i can insert it in MySQL data base

1 view (last 30 days)
Im facing an issue! i have been trying to insert data that is fetched from mySQL DB via matlab using cursor, to another table in MySQL after image processing. but facing these errors:
Error using imread>parse_inputs (line 458) The filename or url argument must be a string.
Error in imread (line 317) [filename, fmt_s, extraArgs] = parse_inputs(varargin{:});
Error in db1 (line 17) d = imread(curs.data(:));
I have tried to convert cursor to string but have failed so far..
Here is my code:
function [rr] = db1()
sqlquery = 'select Disease_Image from disease_image where Processed is NULL';
conn = database('e_gardener','root','',...
'Vendor','MySQL',...
'Server','localhost');
curs = exec(conn,sqlquery);
% Initialize rowlimit
rowlimit = 1
% Check for more data. Retrieve and display all data.
while ~strcmp(curs.Data,'No Data')
curs = fetch(curs,rowlimit);
curs.Data(:)
d = imread(num2str(curs.data(:)));
rr = Detect(d);
datainsert(conn,'photo_maths',{'Result'},{rr});
end
end

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!