C++builder call matlab

Source: Internet
Author: User
Tags mixed

Borland C++builder is a novel visual programming language. In the engineering application, we generally use the C++builder language to write the application, realizes the interactive interface, the data acquisition and the port operation and so on, but c++builder in the numerical processing analysis and the algorithm tool and so on aspect, its efficiency is far lower than MATLAB language. In the accurate and convenient rendering of data graphics, MATLAB language has incomparable advantages. In addition, MATLAB also provides a powerful toolbox. However, the disadvantage of MATLAB is not to achieve port operation and real-time control. Therefore, if the combination of the two can be used to achieve complementary advantages, will obtain great benefits.

This paper introduces the method of invoking MATLAB in WinDOS application Borland c++builder3.0 developed by combining with practice.

One, the c++builder call MATLAB realization plan

1. Realize the idea

In the high version of MATLAB (such as Matlab V4.2) provides a DDE interface, users can use the Windows DDE Communication Base system to implement external calls. This implementation is relatively simple, but will increase the main program code, affecting the speed of operation.

In Windows systems, DLLs are a very special executable file that can be accessed simultaneously by multiple Windows applications with a fixed shared data segment. The data segment data is kept in memory until the DLL is downloaded by Windows, so you can implement the data transfer and function call between the user program and MATLAB through the DLL.

Specifically, the use of MATLAB 32-bit Dynamic connection library (DLL), to generate the corresponding can be called C++builder DLL, to provide a basic support environment between the two. You can share data segments by simply loading the DLL in the user program. Then in the user program to manipulate the data section of the DLL, and through a certain way in the user program in the MATLAB to execute the DLL, you can implement the user program to the MATLAB call. The form can be mixed programming or function calls, very convenient and efficient.

2. How to Achieve

MATLAB provides the external connection of the DLL file, by converting it to the corresponding Lib file, and the necessary settings, you can directly in the C++builder MATLAB function call, the realization of C + + Builder language and MATLAB language mixed programming.

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.