Proficient VC and MATLAB joint programming (VII)

Source: Internet
Author: User
Tags header

Matlab Compiler is a compiler with MATLAB, it can convert m file into C, C + + or p and other types of source code, and according to the need to generate executable files, lib files (library files), DLL files or S function files. MATLAB 6.5 uses the compiler to include the MATLAB c\c++ Mathematics library function as well as the graphics library. Dynamic link library (DLL) is a commonly used technology in writing software, MATLAB provides a way to make the M file into DLL file, this article describes how to convert m file z to DLL file in MATLAB6.5, then call the DLL file in VC.

1, must ensure the correct configuration of the compiler, because the compiler used the c\c++ library functions, so before use to use

Mex-setup and

Mbuild-setup

Two commands are configured for the compiler, which is not required if you have previously configured it.

2, set the header file and library file path, you can refer to proficient VC and MATLAB joint programming < Six, configuration completed as shown in Figure 1 and Figure 2:

Figure 1

Figure 2

The reader according to MATLAB installation actual situation input header file and library file path.

3, in the Matlab Open Text Editor (file->new->m-file) to write a simple M function:

function y=huatu_test()
x=-10:0.1:10;
y=sin(x);
plot(x,y,''*'')

File is saved as HUATU_TEST.M.

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.