Connect to an Access database in the MATLAB programming environment

Source: Internet
Author: User

Recently in the use of MATLAB to do the course project, involving the data additions and deletions, initially decided to use Excel as the target data file, and later for programming simple, decided to use Access to do data files.

The first thing to solve is, configure the desktop data source, My computer is WINDOWS10, so win+s, pop-up search box, enter the data source, select the corresponding 32-bit and 64-bit program, found on the Internet connection Access tutorial, not clear the selection program corresponding to the number of digits, Be sure to choose the number of bits of your computer system here.

Specific configuration:

Data source (ODBC)---"User dsn--" added. Create a data source sampledb. (select the number of digits of the computer system)

Operation of the Access database, MATLAB provides two ways,

One is to visualize the operation, enter >>querybuilder in the command window

The second is the code operation database, the specific common code is as follows:

(1) Connection database: Conn=database (SampleDB, ' username ', ' password ');

(2) Ping (conn);

(3) Open cursor, execute SQL statement: CURSOR=EXEC (conn, ' select * from time ') this out can also perform SQL update (add, delete) database information;

(4) Reading data from the cursor: result=fetch (cursor) The data type of result is cell;

(5) Close cursors and Links: close (cursor); close (conn);

Connect to an Access database in the MATLAB programming environment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.