⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 matlabsharedlib.cpp

📁 Introduction Some times it is required that we build a shared library (DLL) from an m-file. M-files
💻 CPP
字号:
// MatlabSharedLib.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "matlab.h"
#include "MeanFunctionLib.h"

#pragma comment(lib, "libmx.lib")
#pragma comment(lib, "libmatlb.lib")
#pragma comment(lib, "libmat.lib")
#pragma comment(lib, "libmmfile.lib")
#pragma comment(lib, "MeanFunctionLib.lib")

int main(int argc, char* argv[])
{
	mxArray* result;
	mxArray* x;
	double myArray[5]={10.2, 3, 6.3, 5.4, 5.9};
	
	x=mxCreateDoubleMatrix(1, 5, mxREAL);
	memcpy(mxGetPr(x), myArray, 5 * sizeof(double));

	MeanFunctionLibInitialize();

	result=mlfMeanfunction(x);
	
	MeanFunctionLibTerminate();

	mlfPrintMatrix(result);

	mxDestroyArray(x);
	mxDestroyArray(result);
	
	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -