필터 지우기
필터 지우기

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 CenterFile Exchange에서 Web Services에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by