Analysis of VC and MATLAB Joint programming (III.)

Source: Internet
Author: User
Tags object model

In the "Analysis of VC and MATLAB joint programming < a >" and "Analysis of VC and MATLAB joint programming < two >" introduced matcom, this tool can be written in Matlab, the M file translated into C + + files, or executable (EXE) or library files (DLL). But matcom in many aspects also have limitations, for example, to struct and other classes of support is flawed, some of the drawing statements can not achieve or get accurate images, especially the three-dimensional image.

In fact, VC and MATLAB interface to achieve a variety of methods, matcom is just one of them, this article introduces a relatively easy to implement the method: COM interface method. COM (Compponent object Model module) is a more complex technology, the details of a few books can not finish, so here is not to introduce, this article through an example of how to do in the MATLAB COM components, and how to call the COM components in VC.

First in the MATLAB editor to edit the M function file: Start Matlab->file->new->m-file function content as shown in Figure 1: This function has no input and output parameters, the file is saved as HUATU.M.

Figure 1 m function huatu.m

In the MATLAB set up the COM component, the steps are as follows:

1, in the MATLAB command window to enter the following commands:

>> Comtool

The COM editing interface appears, as shown in Figure 2:

Figure 2 COM Component Editing interface

2, New project: File->new project ..., as shown in Figure 3.

Figure 2 COM Component property settings

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.