结合Matlab& JavaScript:集成方法? [英] Combining Matlab & JavaScript: Methods of integration?

查看:733
本文介绍了结合Matlab& JavaScript:集成方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个MatLab脚本,我想在我的Javascript算法中使用它。有没有办法让JavaScript调用MatLab脚本?更好的是,有没有办法松散地耦合MatLab脚本和Javascript页面?

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?

我发现这一页讨论了使用.NET服务器来保存MatLab脚本/代码( http://www.mathworks.com/matlabcentral/answers/9521 ),但有没有其他更简单的方法来实现这一点?

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

我宁愿不必在JavaScript中重新编写MatLab代码。理想情况下,我想使用我的JavaScript,因为它目前可以直接将指定格式的字符串吐出到MatLab脚本中,并在该算法完成后访问其字符串输出。

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.

我有什么方法可以做到这一点?如果只有.NET或类似的方法,有没有人有足够的资源来指导如何做到这一点,甚至更好,个人经验如何设置?

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?

提前谢谢。

重访注意事项(2013年12月17日)&决策:事实证明,最终我将MatLab脚本重新编码为JavaScript变得更容易。谷歌闭包不久前发布了JavaScript,它为JavaScript语言提供了一些优秀的扩展功能,我强烈推荐给任何有兴趣使用它的人。我特别使用了它的矩阵库,它允许我重新编码和用JavaScript设计我的Nodal电压分析方法。请查看: https://developers.google.com/closure/

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 recommend 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.com/closure/

推荐答案

对于部署,matlab总是需要在服务器端运行,主要是通过java或.net。但是你可以在matlabs浏览器中使用javascript和matlab。它不是很漂亮,并使用matlab:命令。 此处提供了一个教程,下面的代码执行原因脚本。

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

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

这篇关于结合Matlab&amp; JavaScript:集成方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆