admin管理员组

文章数量:1278948

I have a MatLab script that I would like to use in my Javascript algorithm. Is there any way of getting JavaScript to call a MatLab script? Better yet, is there any way to loosely couple a MatLab script and a Javascript page?

I found this one page that discussed using .NET server to hold the MatLab script/code (), but are there any other easier methods to get this working?

I would much rather not have to re-code the MatLab in JavaScript. Ideally, I would like to use my JavaScript as it currently works to spit a string of a specified format into a MatLab script directly and access its string output after that algorithm is done.

What are the ways in which I can do this? If there is only the .NET or similar approach, does anyone have good resources to guide how to do this carefully or even better, personal experience with how to set this up?

Thank you in advance.

Revisit NOTE (Dec 17, 2013) & Decision Made: It turns out that in the end it proved easier to just re-code my MatLab script into JavaScript. Google Closure was released for JavaScript a while ago, and it provides a beautiful bit of extended functionality to the JavaScript language, and I highly remend it to anyone interested in using it. I particularly made use of its Matrix library, which allowed me to re-code & design my Nodal Voltage Analysis method in JavaScript. Check it out: /

I have a MatLab script that I would like to use in my Javascript algorithm. Is there any way of getting JavaScript to call a MatLab script? Better yet, is there any way to loosely couple a MatLab script and a Javascript page?

I found this one page that discussed using .NET server to hold the MatLab script/code (http://www.mathworks./matlabcentral/answers/9521), but are there any other easier methods to get this working?

I would much rather not have to re-code the MatLab in JavaScript. Ideally, I would like to use my JavaScript as it currently works to spit a string of a specified format into a MatLab script directly and access its string output after that algorithm is done.

What are the ways in which I can do this? If there is only the .NET or similar approach, does anyone have good resources to guide how to do this carefully or even better, personal experience with how to set this up?

Thank you in advance.

Revisit NOTE (Dec 17, 2013) & Decision Made: It turns out that in the end it proved easier to just re-code my MatLab script into JavaScript. Google Closure was released for JavaScript a while ago, and it provides a beautiful bit of extended functionality to the JavaScript language, and I highly remend it to anyone interested in using it. I particularly made use of its Matrix library, which allowed me to re-code & design my Nodal Voltage Analysis method in JavaScript. Check it out: https://developers.google./closure/

Share Improve this question edited Mar 10, 2024 at 4:56 Nick ODell 25.5k7 gold badges45 silver badges87 bronze badges asked Apr 16, 2013 at 19:31 9codeMan99codeMan9 8526 gold badges11 silver badges26 bronze badges 2
  • Matlab will need to be run on the server. You will have to make a call to some serverside language (a .NET app or other) – Ben McCormick Commented Apr 16, 2013 at 19:36
  • PHP interfacement is also possible – Acorbe Commented Apr 16, 2013 at 19:38
Add a ment  | 

2 Answers 2

Reset to default 8

For deployment matlab will always need to be run on server side mostly via java or . However you can use javascript and matlab inside matlabs browser. Its not very pretty and makes use of the matlab: mand. A tutorial is given here and the bellow code executes the why script.

<a href=”matlab:why”>Why?</a>

From the 16B version there is a way to talk to MATLAB from JavaScript using MPS and RESTFUL. Here is am example link http://www.mathworks./help/mps/restfuljson/example-web-based-bond-pricing-tool-using-javascript.html

本文标签: Combining Matlab amp JavaScript Methods of integrationStack Overflow