蔡諝的窝

博客园 首页 新随笔 联系 订阅 管理

2011年6月24日 #

摘要: 直接给出步骤:1)设置Matlab的编译器,见【MATLAB与C的混合编程】之【MATLAB调用C程序】2)编译m文件成dll.【2.1】---------建立MyAdd.m-------------function [c] = MyAdd(a, b);c = a + b;-----------------------------------【2.2】Matlab中运行mcc -W cpplib:libMyAdd -T link:lib MyAdd成功后,我们会发现目录下多了很多文件,其中libMyAdd.dll、libMyAdd.lib、libMyAdd.h为有用文件,接下来要用到。3)设置 阅读全文
posted @ 2011-06-24 16:28 蔡諝 阅读(3440) 评论(0) 推荐(0)

摘要: 本就就针对网上到处流行的以“Matlab与C/C++混合编程”为题的例子进行调试。此例已调试成功,代码如下:#pragma comment( lib, "libmx.lib" )#pragma comment( lib, "libmex.lib" )#pragma comment( lib, "libeng.lib" )#include<windows.h>#include "engine.h"#include<iostream>using namespace std;int PASCAL 阅读全文
posted @ 2011-06-24 15:43 蔡諝 阅读(670) 评论(0) 推荐(0)

摘要: 本文是调试Matlab中自带的例子,已成功。/** engwindemo.c** This is a simple program that illustrates how to call the MATLAB* Engine functions from a C program for windows** Note: * Use the Lcc or Microsoft Visual C++ compiler to build engwindemo.exe. * The source code in engwindemo.c is not supported for other compil 阅读全文
posted @ 2011-06-24 15:11 蔡諝 阅读(766) 评论(0) 推荐(0)

摘要: 本程序特色:VS2008的C++程序中调用Matlab进行画图先贴本人调试通过的代码:#pragma comment(lib, "libmx.lib")//#pragma comment(lib, "libmat.lib")//注销了也没关系#pragma comment(lib, "libeng.lib")#include <math.h>#include "engine.h"#include <iostream>using namespace std;int main(){ const 阅读全文
posted @ 2011-06-24 14:48 蔡諝 阅读(2462) 评论(0) 推荐(0)