是否可以从 Silverlight / C# 调用 matlab 函数?
是否可以从 Silverlight / C# 调用 matlab 函数?
Is it possible to call matlab functions from Silverlight / C# ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果您有一个可以解释 Mathlab 调用的程序集 (dll),您应该能够将该程序集包含在您的项目中,并将其与应用程序的其余部分一起编译。
显然,您将无法并行运行 Silverlight 来与已安装的 Matlab 实例进行交互(除非 API 通过 COM 互操作公开并使用 Silverlight 4,但这可能会变得混乱)。
正如 Matt 提到的,如果您找不到直接包含在 Silverlight 应用程序中的程序集,sourceforge 上的 Web API 似乎非常适合。请阅读我的评论以获取进一步的想法。
If you have an assembly (dll) that can interpret Mathlab calls, you should be able to include that assembly in your project and compile it with the rest of your application.
Obviously, you won't be able to run Silverlight side-by-side to interface with an installed instance of Matlab (unless the API is exposed through COM interop and using Silverlight 4, but that could get messy).
The Web API on sourceforge, as mentioned by Matt, seems like a really good fit if you can't find assemblies to include directly within your Silverlight application. Read my comments there for further thoughts.
我认为这对于您打算在浏览器中运行的 Silverlight 来说是不可能的,尽管您当然可以使用 WPF 作为 Windows 应用程序。
但是,您可以使用 Matlab Server Pages (MSP) 将 Matlab 功能公开为 Web 服务,然后使用 silverlight 中的功能。
http://msp.sourceforge.net
特别令人感兴趣的是本教程,展示如何从 C# 访问 MSP Web 服务。
http://msp.sourceforge.net/Tutorial/tutor13.htm
I dont think this will be possible for Silverlight that you are intending to run in the browser, although you certainly could using WPF as a Windows app.
However you could expose Matlab functionality as a webservice using Matlab Server Pages (MSP), and then consume the fucntionlaity from silverlight.
http://msp.sourceforge.net
Of particular interest isthis tutorial showing how to access a MSP webservice from C#.
http://msp.sourceforge.net/Tutorial/tutor13.htm
您可以使用Matlab API for .NET
You can use the Matlab API for .NET
您将在此页面找到答案
http://tech-michael.blogspot.com/2010 /01/silverlight-communicating-with-matlab.html
我希望这会有所帮助。
You will find your answer on this page
http://tech-michael.blogspot.com/2010/01/silverlight-communicating-with-matlab.html
I hope this helps.