in matlab's database toolbox, used data explorer set data source corresponding accdb file. there way perform data explorer functions using code rather gui?
this has been posted on:
the following response tmw solved problem:
'...the file dsn example on database function page? example titled: “connect microsoft access using file dsn”. allows build path can use in database function last input argument. in case, no data source setup required. hence, can done writing code on command line or matlab script.'
here sample code uses above solution connect *.accdb file, pull in data, , use data:
wbe3accdb_path='c:\cygwin64\home\my.user.name\projects\someproject\wbes\wbe3\wbe3.accdb'; wbe3accdb_url= [ 'jdbc:odbc:driver={microsoft access driver (*.mdb, *.accdb)};dsn='';dbq=' wbe3accdb_path ]; conn = database('','','','sun.jdbc.odbc.jdbcodbcdriver',wbe3accdb_url); curs=exec(conn,'select * sometableinaccdbdatabase') curs=fetch(curs) columnnames(curs) close(conn) scatter( ... curs.data.somenumericalfieldname, ... curs.data.anothernumericalfieldname, ... 's' ... ) set(gca,'xscale','log','yscale','log') corr( ... curs.data.somenumericalfieldname, ... curs.data.anothernumericalfieldname, ... 'rows', ... 'pairwise' ... )
Comments
Post a Comment