Run Matlab code from Javascript
50 次查看(过去 30 天)
显示 更早的评论
Hi, I have my own website and would like to allow people (my website's visitors) to run little funny Matlab scripts or commands directly on my website. How can I run Matlab commands from Javascript ? Thanks. F.
1 个评论
Jan
2017-6-23
Does this mean, that vistors of your web site can run a Matlab function, which calls sendmail to distribute millions of spam mails? Or crash your server by for k = 1:1e5; c{k}=rand(1,1e5); end? A Matlab script could display the contents of your license file. I would not dare to offer such a service in public.
回答(2 个)
Nhan Nguyen
2017-6-23
I'm looking for it too. Actually I also want to use the javascript to call matlab code while the matlab code calls ansys and abaqus analyses.
1 个评论
Jan
2017-6-23
Does this mean that you offer your Matlab and Ansys license to be used for free? Is this covered by the license agreements?
James Taylor
2021-9-16
For several options to run commands remotely from JS.
Matlab scripts may be run at the command line, using matlab as an interpreter. This is actually accomplished (somewhat) differently depending on your environment, My normal arrangement would use a #!matlab first line, executed in a bash shell.
License types vary, so your mileage may vary. Using your local matlab as a script engine to allow packaged program scripts to be executed seems within fair use, unless specifically forbidden, say by a single user license as opposed to a single machine license. The fair use would be similar to the current matlab compiler license that allows an executable to be distributed which includes the matlab engine.
All that said, as was discussed at that initial link, the suggested action, to execut a program or script remotely you must break the JS security model. Don't.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Web Services 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!