开发者

Non-windows way to invoke Matlab from Mathematica

开发者 https://www.devze.com 2023-02-14 10:49 出处:网络
This was asked before, but the solution doesn\'t seem to work on MacOS. Wolfram Library has a package for 7 year old Matlab version. Is there a solution that works on MacOS 10.6 and Matlab 7.9?

This was asked before, but the solution doesn't seem to work on MacOS. Wolfram Library has a package for 7 year old Matlab version. Is there a solution that works on MacOS 10.6 and Matlab 7.9?

I want to c开发者_如何转开发all CVX from Mathematica


You could use RunThrough["command",expr], this runs the external command command, and feeds expr (a Mathematica expression) as input to command

An example of a suitable command would be "matlab -r \"matlab expr\"", you could place your CVX specific code in the "matlab expr" string.


Update: Right now, probably MATLink is the best way to do this. It works on Windows/Linux/Mac.

Disclosure: I'm one of MATLink's authors.


Have you tried using the newer mEngine instead? I can only try it on Windows, but after looking at the sources, I believe it might work on other platforms too.

Hopefully you only need to modify main.c, actually just copy and paste the main function from one of the MathLink examples (e.g. addtwo), as mEngine's main.c has the non-Windows-specific part removed. Then compile the package as a MathLink program.

0

精彩评论

暂无评论...
验证码 换一张
取 消