フィルターのクリア

Run Matlab code from Javascript

50 ビュー (過去 30 日間)
Frédéric Girod
Frédéric Girod 2017 年 3 月 31 日
回答済み: James Taylor 2021 年 9 月 16 日
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
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
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
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
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.

カテゴリ

Help Center および File ExchangeWeb Services についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by