MATLAB Answers

How can I determine if a matlab app is running as a web app?

조회 수: 10(최근 30일)
Roger Schvaneveldt
Roger Schvaneveldt 2 Nov 2020
I need to retrieve and save data differently when an app is running as a web app so I need something like is deployed that distinguishes between web deployment and standalone app deployment.
  댓글 수: 1
Roger Schvaneveldt
Roger Schvaneveldt 5 Nov 2020
I found a suggestion that led me to solve the problem with this function which requires creating an empty file named,, and adding that file to the compiled web app.
function tf = iswebdeployed()
% tf = iswebdeployed()
% tests whether an app is running as a web app
% must include a file named when compiling a web app
% tf = isdeployed && exist('', "file");
tf = isdeployed && exist('', "file");

댓글을 달려면 로그인하십시오.


Hiro 2 Nov 2020
Web apps run in your browser and stand-alone app opens your system window(s) and run in it (them).
  댓글 수: 2
Hiro 4 Nov 2020
This is just an idea:
How about using system command from MATLAB to see if there is something running (app) behind MATLAB? You may be able to find the process to raise a flag.
< system command>

댓글을 달려면 로그인하십시오.


Community Treasure Hunt

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

Start Hunting!

Translated by