Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
call Matlab function from C

Subject: call Matlab function from C

From: kumar vishwajeet

Date: 8 Jul, 2011 00:05:10

Message: 1 of 2

I have written a C code under Linux environment. I want to call "sqrtm" function of Matlab in my C code. Is there any way to do that?? I am not looking for cholesky decomposition, which I can find in C using LAPACK/BLAS library. I am looking for principal square root as given by sqrtm.

Thanks.

Subject: call Matlab function from C

From: James Tursa

Date: 8 Jul, 2011 00:23:10

Message: 2 of 2

"kumar vishwajeet" wrote in message <iv5hjm$83t$1@newscl01ah.mathworks.com>...
> I have written a C code under Linux environment. I want to call "sqrtm" function of Matlab in my C code. Is there any way to do that?? I am not looking for cholesky decomposition, which I can find in C using LAPACK/BLAS library. I am looking for principal square root as given by sqrtm.
>
> Thanks.

Yes, it is possible with either a mex function or an Engine application. Look under External Interfaces in the doc. The functions you will need to use are mexCallMATLAB or my FEX submission engCallMATLAB.

James Tursa

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us