Author: Liu Wei
Publisher:
Publish Date: 2005-06-01
Features: This book primarily introduces how to use MATLAB and C/C++ for mixed programming. It comprehensively and detailedly covers MATLAB C/C++ mathematical library, Matcom, MATLAB COM Builder, MATLAB Engine, and compiling MATLAB standalone executable programs, among other topics related to MATLAB mixed programming. The book is divided into 7 chapters, mainly including: basic knowledge of MATLAB programming, MATLAB C/C++ language interface, how to generate standalone MATLAB programs, calling MATLAB programs in Visual C++, Matcom, MATLAB COM Builder and Visual C++ mixed programming, and calling MATLAB C/C++ mathematical library in Visual C++. Each chapter of the book contains numerous example programs, providing MATLAB programmers seeking to run MATLAB programs outside the MATLAB environment and C/C++ developers seeking efficient algorithm libraries with learning and reference materials. The development and running environment adopted in this book is: Visual C++ 6.0 and MATLAB 6.5.
[Preface]
I first encountered MATLAB during my undergraduate studies when participating in the "Undergraduate Mathematical Contest in Modeling." At that time, the only feeling I had was "too late to meet." Later, while pursuing my graduate studies and working on research projects, I began using Matcom to compile MATLAB programs to achieve faster processing speeds and used Matcom's C matrix library to enjoy the efficiency of matrix operations while seamlessly integrating with the Visual C++ 6.0 development environment. Later, MathWorks acquired Matcom and integrated its functionality into MATLAB. Until the release of MATLAB 6.5, MATLAB and C/C++ mixed programming added many new features, such as the MATLAB C/C++ language interface, MATLAB C/C++ mathematical library, MATLAB COM Builder, and Matcom, among others, leading to the emergence of various "schools" of MATLAB and C/C++ mixed programming.
The MATLAB C/C++ language interface refers to a set of C language API functions provided by MATLAB for user calls. These C language API functions serve as a bridge between MATLAB and user C code. Users can call C language API functions in MATLAB's MEX files or in a pure C/C++ development environment. The MATLAB C/C++ mathematical library is a set of encapsulated matrix operation mathematical libraries provided by MATLAB, with usage methods very similar to those in the MATLAB environment. If a user uses VC (for convenience, VC in this book refers to Visual C++) to implement a user interface and is looking for a set of efficient matrix operation mathematical libraries, the MATLAB C/C++ mathematical library is a good choice.
MATLAB COM Builder can compile MATLAB functions expressed in .m files into COM components. This is also a recommended method by MathWorks for MATLAB mixed programming. Many files that have errors when compiled with MATLAB compilers can be well resolved using MATLAB COM Builder. However, the specific operation in VC to call COM components is slightly more complex than calling C mathematical libraries and C language API functions.
Matcom is a tool that can compile MATLAB's .m files into C/C++ code. Now, MathWorks has integrated it into MATLAB, making it unnecessary to use Matcom to compile .m files anymore. However, Matcom's C matrix library still has value, as it is simpler and more convenient to use compared to the MATLAB C/C++ mathematical library.
It can be seen that the various methods of MATLAB and C/C++ mixed programming each have their own strengths, and the specific choice should be based on the developer's circumstances. Regardless of which method is used, the mutual access and conversion between MATLAB's data structures and C/C++'s data structures are key, and this is also the focus of this book. I hope readers pay attention to this while reading the book.
All the source code in this book can be found on the accompanying CD-ROM. Additionally, to match the programs in the book and ensure consistency in the overall style, all symbols in this book are written in upright type.
Due to the author's limited abilities, if readers have any questions about the content of this book or discover any errors, please send emails to matlab_vc_program@yahoo.com.cn to discuss or correct them. Thank you!
During the writing of this book, I received support and assistance from many colleagues. Special thanks go to Li Lu, Li Qun, Lu Ruiqiang, Wu Wei, Zhou Zhiyong, and Wang Guofang for their support. Many key issues related to Visual C++ 6.0 and MATLAB programming were resolved through discussions with these six colleagues. Moreover, they provided many valuable resources for this book. I also want to thank Ms. Qi Chunxi for diligently completing the preliminary layout of all chapters in this book and identifying many errors in the manuscript.
Finally, I want to thank all the people who have contributed to the completion of this book. Without their help and dedication, this book would not have been possible.
Proficient in mixed programming design of Matlab and C/C++
📌 Related Posts
Literature
Rare Bird Breeding and Disease Prevention
2026-09-23
Literature
Works of Ding Shaoguang
2026-09-24
Literature
100 Events That Influenced Chinese History
2026-09-22
Literature
Principles of Management
2026-09-26
Literature
Dental Technology and Craftsmanship (Vol. 1, 2, and 3)
2026-09-27
Literature
Electronic Circuit Design Guide
2026-09-27
Literature
Chinese-English Medical Molecular Biology Experimental Methods
2026-09-27
Literature
Hydraulic transmission
2026-09-27