Quantcast
Channel: MATLAB Central Newsreader Recent Posts
Viewing all articles
Browse latest Browse all 19628

Re: Running CDF player using MATLAB through MATLink

$
0
0
On Monday, 3 June 2013 08:27:09 UTC+2, Abhishek wrote:
> Hi all,
>
>

Hello,

>
> As you might be knowing, MATLink links Matlab code to Mathematica and hence we can call a matlab program through mathematica and vice verse.
>

To be precise, MATLink allows calling MATLAB from Mathematica, but *not* the reverse. As of MATLink 1.0, it is not possible to call back to Mathematica from MATLAB.

>
>
> I did the same, wrote and matlab code in mathematica and it did work.

I'm happy you are finding the package useful :-)

> I converted it to CDF format to create a dynamic applet, but the CDF format does not seem to interpret the matlab code.
>
>
>
> Does MATLink work with CDF player? Or is there any other way to make a matlab code to interact with the CDF player?
>

CDF, at least FreeCDF, was not really designed to do such things. CDFs may run in the browser through a plugin. For security, CDF player will refuse to run anything that might access your system the way MATLink does (file operations, etc.) It's also designed to prevent using it as a full Mathematica version.

So the short answer is: this is most likely not possible and if it is, it's too much trouble to make it worthwhile.

A longer answer:

To be able to use MATLink, you need two essential capabilities:

* loading packages
* using the MathLink communication protocol

Now there are ways around some of CDF player's limitations, but not all. If you are using the standalone CDF player (not the browser plugin), then it should show a yellow bar at the top of the document with a button that lifts the security limitations. Some claim that this will allow using MathLink connections, but I am not convinced that this actually works in the latest version of the CDFPlayer, as it would probably make it possible to use the CDFPlayer as a full version of Mathematica. Anyway, you can experiment and try:

http://mathematica.stackexchange.com/q/5604/12

It still won't be possible to load packages, so you'd need to embed the MATLink package into the CDF while making some modification to hard-code essential paths (paths to the mengine executable, MATLAB, etc.) This would be a non-trivial task.

If you are really determined to try to get it working, this would be the way to start experimenting. But I would be surprised if it turned out to be possible despite the CDF player limitations.

Also, as Nasser said, feel free to send questions to the email address at the bottom of http://matlink.org/

>
>
> Thanks in advance.

Viewing all articles
Browse latest Browse all 19628

Trending Articles