By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,422 Members | 1,414 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,422 IT Pros & Developers. It's quick & easy.

use of mxArray in C#

P: n/a
Hi all

I give you here some example code how to make it possible to use the type
mxArray (from matlab) in c and c++. mxArray is defined in matlab.h and
matlab.hpp. To use mxArray in c or c++ you need to include this h-file..and
maybe some libraries also.
My question is: How can I use mxArray in C#??

(If it is this easy in c and c++ there must be a way out in c# also..)

---------------------------------------------------
#include "mat.h"
#include "matlab.h"

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

void main(int argc, char **argv)
{
mxArray *pa;
....

--------------------------------------------------
#include "matlab.hpp" //Interface of MATLAB CPP Math Library

//Add C++ Math Library to project
#pragma comment(lib, "libmatpm.lib")
#pragma comment(lib, "libmx.lib")
#pragma comment(lib, "libmatlb.lib")
#pragma comment(lib, "libmat.lib")
#pragma comment(lib, "libmmfile.lib")
#pragma comment(lib, "libmatpm.lib")
....
----------------------------------------------------
Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,

I think you should post this question in a Matlab newsgroup. The following
reference : www.pinvoke.net can be helpfull.

Regards,
Bart

--
http://www.xenopz.com
"snowflake" <sn*******@discussions.microsoft.com> wrote in message
news:D7**********************************@microsof t.com...
Hi all

I give you here some example code how to make it possible to use the type
mxArray (from matlab) in c and c++. mxArray is defined in matlab.h and
matlab.hpp. To use mxArray in c or c++ you need to include this
h-file..and
maybe some libraries also.
My question is: How can I use mxArray in C#??

(If it is this easy in c and c++ there must be a way out in c# also..)

---------------------------------------------------
#include "mat.h"
#include "matlab.h"

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

void main(int argc, char **argv)
{
mxArray *pa;
...

--------------------------------------------------
#include "matlab.hpp" //Interface of MATLAB CPP Math Library

//Add C++ Math Library to project
#pragma comment(lib, "libmatpm.lib")
#pragma comment(lib, "libmx.lib")
#pragma comment(lib, "libmatlb.lib")
#pragma comment(lib, "libmat.lib")
#pragma comment(lib, "libmmfile.lib")
#pragma comment(lib, "libmatpm.lib")
...
----------------------------------------------------

Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.