请各位帮忙,谢谢!
1. VQB(visual query builder)
2. Using fuctions
VQB:在matlab中敲打querybuilder命令,即可出现画面,比较简单,这种方法用处不太大,但是特别简单,主要可以通过matlab把数据库中的内容形象的表达出来,可以利用pie,等等方式
用m函数的方法,下面贴出matlab中的一个例子,主要功能是读去数据库中的数据
function dbimportdemo()
%DBIMPORTDEMO Imports data into MATLAB from a database.
% Version 1.0 21-Oct-1997
% Author(s): E.F. McGoldrick,
% Copyright 1984-2002 The MathWorks, Inc.
% $Revision: 1.9 $ $Date: 2002/06/17 12:00:49 $
% Set maximum time allowed for establishing a connection.
timeoutA=logintimeout(5)
% Connect to a database.
connA=database('SampleDB','','')
% Check the database status.
ping(connA)
% Open cursor and execute SQL statement.
cursorA=exec(connA,'select country from customers');
% Fetch the first 10 rows of data.
cursorA=fetch(cursorA,10)
% Display the data.
AA=cursorA.Data
% Close the cursor and the connection.
close(cursorA)
close(connA)
原文连接:
http://chinavib.com/forum/viewthread.php?tid=7357
还有一个:
http://www.blog.edu.cn/user1/9009/archives/2005/372042.shtml
其他自己去找找看啊
谢谢版主,这个程序我也搜到了,不过运行后出现问题如下:
timeoutA =
5
connA =
Instance: 'db1.mdb'
UserName: ''
Driver: []
URL: []
Constructor: [1x1 com.mathworks.toolbox.database.databaseConnect]
Message: [1x45 char]
Handle: 0
TimeOut: []
AutoCommit: 'off'
Type: 'Database Object'
??? Error using ==> database.ping
Invalid connection.
Error in ==> dbimportdemo at 39
ping(connA)
不知怎么解决?