Thread Subject: Is MCR required for standalone applications?

Subject: Is MCR required for standalone applications?

From: Ahmed ElDessouki

Date: 9 Apr, 2008 20:37:02

Message: 1 of 4

Hello,

I have a program written in C, and I wish to add an
algorithm to improve its speed. I have that figured out, and
I need to use a cumulative inverse chi squared distribution.
My variable would be the degrees of freedom; so I would need
to use the MatLab function chi2inv(x,y)

I need to be able to pass the variable y from within my C
code, and compile it as a standalone application. I have
figured out that I need to use MatLab compiler (mcc).

Now, my question is: Do I need to have MCR installed on the
computer I want to use my application on? Is there any way
around this? From my understanding is that the mcc command
allows me to access my M files from my C code, but it then
uses MCR to do do the computations. Is this correct? And is
there any way to do it so that everything is done from
within one executable?


Thank you for your time.

Subject: Is MCR required for standalone applications?

From: Peter Boettcher

Date: 9 Apr, 2008 21:31:38

Message: 2 of 4

"Ahmed ElDessouki" <ahmed.eldessouki@gmail.com> writes:

> Hello,
>
> I have a program written in C, and I wish to add an
> algorithm to improve its speed. I have that figured out, and
> I need to use a cumulative inverse chi squared distribution.
> My variable would be the degrees of freedom; so I would need
> to use the MatLab function chi2inv(x,y)
>
> I need to be able to pass the variable y from within my C
> code, and compile it as a standalone application. I have
> figured out that I need to use MatLab compiler (mcc).
>
> Now, my question is: Do I need to have MCR installed on the
> computer I want to use my application on? Is there any way
> around this? From my understanding is that the mcc command
> allows me to access my M files from my C code, but it then
> uses MCR to do do the computations. Is this correct? And is
> there any way to do it so that everything is done from
> within one executable?

I would suggest that MATLAB is a rather large dependency to be
introducing into your C-based project, only for one function: chi2inv.

Two options:

1- Implement chi2inv in C. As you develop for now, you can use the
MATLAB engine to use chi2inv, and have your C port ready for using on
other machines.

2- Use a different library better suited for C-based math. I recommend
the GNU Scientific Library:

http://www.gnu.org/software/gsl/
or here for Windows:
http://gnuwin32.sourceforge.net/packages/gsl.htm

The documentation for the inverse chi-squared CDF is here:
http://www.gnu.org/software/gsl/manual/html_node/The-Chi_002dsquared-Distribution.html

-Peter

Subject: Is MCR required for standalone applications?

From: Ahmed ElDessouki

Date: 10 Apr, 2008 14:39:02

Message: 3 of 4

Thanks Peter.
I was originally looking for a C library but failed to find
one. I will look into this one in more detail now. Your help
is much appreciated.

However, for the purpose of other projects which are more
dependent on MatLab, what's the take on the need of MCR?

Thanks, again.

Subject: Is MCR required for standalone applications?

From: Bruno Luong

Date: 10 Apr, 2008 16:38:02

Message: 4 of 4

"Ahmed ElDessouki" <ahmed.eldessouki@gmail.com> wrote in
message <ftl8q6$r1i$1@fred.mathworks.com>...
>
> However, for the purpose of other projects which are more
> dependent on MatLab, what's the take on the need of MCR?
>

You can't escape the need of MCR.

Bruno

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
gnu scientific ... Ahmed ElDessouki 10 Apr, 2008 15:52:42
programming Ahmed ElDessouki 9 Apr, 2008 16:40:25
c Ahmed ElDessouki 9 Apr, 2008 16:40:25
mcr Ahmed ElDessouki 9 Apr, 2008 16:40:25
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com