f



How to call matlab functions directly from C++ /without calling matlab engine

How to call matlab functions directly from C++ without calling matlab
engine.
as it is described in this tutorial:

http://www.codeproject.com/samples/matlab_cpp.asp

I have tried to do something similar in Visual Studio 2005 [Matlab 7,
r14]

#include <mclcppclass.h>

....

mwArray A, B, C;
A = magic(mwArray(5));
B = transpose(A);

....

but it doesn't compile.
I got following errors:

error C3861: 'magic': identifier not found
error C3861: 'transpose': identifier not found

etc...

I was looking for header files with declarations of this
functions in matlab directory, but there is nothing like
that. There is only declaration of mwArray. How can I call
matlab functions from C++ code ??

Please help me !!!

0
jstachera (1)
10/29/2007 2:08:31 PM
comp.soft-sys.matlab 211265 articles. 25 followers. lunamoonmoon (257) is leader. Post Follow

2 Replies
1324 Views

Similar Articles

[PageSpeed] 5

On Oct 29, 7:08 am, jstach...@gmail.com wrote:
> How to call matlab functions directly from C++ without calling matlab
> engine.
> as it is described in this tutorial:
>
> http://www.codeproject.com/samples/matlab_cpp.asp
>
> I have tried to do something similar in Visual Studio 2005 [Matlab 7,
> r14]
>
> #include <mclcppclass.h>
>
> ...
>
> mwArray A, B, C;
> A = magic(mwArray(5));
> B = transpose(A);
>
> ...
>
> but it doesn't compile.
> I got following errors:
>
> error C3861: 'magic': identifier not found
> error C3861: 'transpose': identifier not found
>
> etc...
>
> I was looking for header files with declarations of this
> functions in matlab directory, but there is nothing like
> that. There is only declaration of mwArray. How can I call
> matlab functions from C++ code ??
>
> Please help me !!!

Have you looked at the matlab to c compiler?  Try help on MCC.

-Chris

0
checkeraz69 (165)
10/29/2007 11:56:41 PM
 jstachera@gmail.com wrote in message 
<1193666911.610631.263300@o3g2000hsb.googlegroups.com>...
> How to call matlab functions directly from C++ without 
calling matlab
> engine.
> as it is described in this tutorial:
> 
> http://www.codeproject.com/samples/matlab_cpp.asp
> 
> I have tried to do something similar in Visual Studio 
2005 [Matlab 7,
> r14]
> 
> #include <mclcppclass.h>
> 
> ...
> 
> mwArray A, B, C;
> A = magic(mwArray(5));
> B = transpose(A);
> 
> ...
> 
> but it doesn't compile.
> I got following errors:
> 
> error C3861: 'magic': identifier not found
> error C3861: 'transpose': identifier not found
> 
> etc...
> 
> I was looking for header files with declarations of this
> functions in matlab directory, but there is nothing like
> that. There is only declaration of mwArray. How can I 
call
> matlab functions from C++ code ??
> 
> Please help me !!!
> 




If you've created a mex file with your C++ code you can 
use mexCallMATLAB

Shelly

0
slames (14)
10/30/2007 2:22:55 AM
Reply: