{"id":9774,"date":"2025-04-18T17:37:24","date_gmt":"2025-04-18T09:37:24","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/9774.html"},"modified":"2025-04-18T17:37:24","modified_gmt":"2025-04-18T09:37:24","slug":"%e9%ba%92%e9%ba%9f%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%e4%bd%9c%e4%b8%ba%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%8c%e5%b9%b6%e4%b8%94%e9%9c%80%e8%a6%81%e5%9c%a8%e6%b5%8f%e8%a7%88%e5%99%a8%e4%b8%8a%e8%b0%83","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/9774.html","title":{"rendered":"\u9e92\u9e9f\u64cd\u4f5c\u7cfb\u7edf\u4f5c\u4e3a\u670d\u52a1\u5668\uff0c\u5e76\u4e14\u9700\u8981\u5728\u6d4f\u89c8\u5668\u4e0a\u8c03\u8bd5 MATLAB"},"content":{"rendered":"<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u5728\u5185\u7f51\u73af\u5883\u4e0b&#xff0c;\u4f7f\u7528\u9e92\u9e9f\u64cd\u4f5c\u7cfb\u7edf\u4f5c\u4e3a\u670d\u52a1\u5668&#xff0c;\u5e76\u4e14\u9700\u8981\u5728\u6d4f\u89c8\u5668\u4e0a\u8c03\u8bd5 MATLAB \u7a0b\u5e8f&#xff0c;\u8fd9\u786e\u5b9e\u590d\u6742&#xff0c;\u4f46\u4ecd\u7136\u6709\u53ef\u884c\u7684\u89e3\u51b3\u65b9\u6848\u3002\u9e92\u9e9f\u64cd\u4f5c\u7cfb\u7edf\u662f\u56fd\u4ea7\u5316\u7684 Linux \u53d1\u884c\u7248&#xff08;\u5982\u57fa\u4e8e Ubuntu Kylin \u6216\u94f6\u6cb3\u9e92\u9e9f&#xff09;&#xff0c;\u56e0\u6b64\u6211\u4eec\u9700\u8981\u57fa\u4e8e\u5176\u7279\u6027\u8bbe\u8ba1\u65b9\u6848&#xff0c;\u540c\u65f6\u8003\u8651\u5185\u7f51\u7684\u9650\u5236&#xff08;\u65e0\u5916\u90e8\u7f51\u7edc\u8bbf\u95ee&#xff09;\u3002\u4ee5\u4e0b\u662f\u8c03\u6574\u540e\u7684\u53ef\u884c\u6027\u65b9\u6848&#xff1a;<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u524d\u63d0\u6761\u4ef6\u4e0e\u5047\u8bbe<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0MATLAB \u652f\u6301&#xff1a;\u5047\u8bbe\u670d\u52a1\u5668\u4e0a\u5df2\u5b89\u88c5 MATLAB&#xff08;\u9e92\u9e9f\u7cfb\u7edf\u652f\u6301 MATLAB \u7684 Linux \u7248\u672c&#xff0c;\u5982 R2023b \u6216\u66f4\u65e9\u7248\u672c&#xff09;\u3002<\/p>\n<p>\u5185\u7f51\u9650\u5236&#xff1a;\u65e0\u6cd5\u8bbf\u95ee MATLAB Online \u6216\u5916\u90e8\u4e91\u670d\u52a1&#xff0c;\u53ea\u80fd\u4f9d\u8d56\u672c\u5730\u90e8\u7f72\u3002<\/p>\n<p>\u6d4f\u89c8\u5668\u76ee\u6807&#xff1a;\u9700\u8981\u5728\u6d4f\u89c8\u5668\u4e2d\u8fd0\u884c\u5e76\u8c03\u8bd5 MATLAB \u4ee3\u7801&#xff0c;\u800c\u4e0d\u662f\u4ec5\u5c55\u793a\u7ed3\u679c\u3002<\/p>\n<p>\u6743\u9650&#xff1a;\u5047\u8bbe\u4f60\u6709\u670d\u52a1\u5668\u7684\u7ba1\u7406\u5458\u6743\u9650\u6765\u5b89\u88c5\u548c\u914d\u7f6e\u76f8\u5173\u8f6f\u4ef6\u3002<\/p>\n<p>\u65b9\u6848 1&#xff1a;\u901a\u8fc7 MATLAB \u548c Web \u670d\u52a1\u5668\u642d\u5efa\u672c\u5730\u8c03\u8bd5\u73af\u5883<\/p>\n<p>\u53ef\u884c\u6027&#xff1a;\u9ad8<\/p>\n<p>\u63cf\u8ff0&#xff1a;\u5728\u9e92\u9e9f\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u8fd0\u884c MATLAB&#xff0c;\u5e76\u901a\u8fc7\u4e00\u4e2a\u8f7b\u91cf\u7ea7 Web \u670d\u52a1\u5668&#xff08;\u5982 Apache \u6216 Nginx&#xff09;\u7ed3\u5408\u811a\u672c\u8bed\u8a00&#xff08;\u5982 Python Flask&#xff09;\u63d0\u4f9b\u6d4f\u89c8\u5668\u4ea4\u4e92\u548c\u8c03\u8bd5\u529f\u80fd\u3002<\/p>\n<p>\u5b9e\u73b0\u6b65\u9aa4&#xff1a;<\/p>\n<p>\u5b89\u88c5 MATLAB&#xff1a;<\/p>\n<p>\u786e\u4fdd\u9e92\u9e9f\u670d\u52a1\u5668\u5df2\u5b89\u88c5 MATLAB \u7684 Linux \u7248\u672c&#xff08;\u53c2\u8003 MathWorks \u5b98\u65b9\u5b89\u88c5\u6307\u5357&#xff09;\u3002<\/p>\n<p>\u6d4b\u8bd5 MATLAB \u662f\u5426\u80fd\u5728\u547d\u4ee4\u884c\u8fd0\u884c&#xff08;\u5982 matlab -nodisplay -r &#034;your_script&#034;&#xff09;\u3002<\/p>\n<p>\u642d\u5efa Web \u670d\u52a1&#xff1a;<\/p>\n<p>\u5b89\u88c5 Web \u670d\u52a1\u5668\u548c Python&#xff1a;<\/p>\n<p>sudo apt-get update<\/p>\n<p>sudo apt-get install python3 python3-pip apache2<\/p>\n<p>pip3 install flask <\/p>\n<p>\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684 Flask \u5e94\u7528&#xff0c;\u7528\u4e8e\u63a5\u6536\u6d4f\u89c8\u5668\u8bf7\u6c42\u5e76\u8c03\u7528 MATLAB&#xff1a;<\/p>\n<p>python<\/p>\n<p>from flask import Flask, request, jsonify<\/p>\n<p>import subprocess<\/p>\n<p>app &#061; Flask(__name__)<\/p>\n<p>&#064;app.route(&#039;\/run&#039;, methods&#061;[&#039;POST&#039;])<\/p>\n<p>def run_matlab():<\/p>\n<p>\u00a0 \u00a0 code &#061; request.json.get(&#039;code&#039;) # \u4ece\u6d4f\u89c8\u5668\u63a5\u6536 MATLAB \u4ee3\u7801<\/p>\n<p>\u00a0 \u00a0 with open(&#039;temp.m&#039;, &#039;w&#039;) as f:<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 f.write(code)<\/p>\n<p>\u00a0 \u00a0 try:<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 result &#061; subprocess.check_output(<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 [&#039;matlab&#039;, &#039;-nodisplay&#039;, &#039;-r&#039;, &#034;run(&#039;temp.m&#039;);exit&#034;],<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 stderr&#061;subprocess.STDOUT, text&#061;True<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 )<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 return jsonify({&#039;output&#039;: result})<\/p>\n<p>\u00a0 \u00a0 except subprocess.CalledProcessError as e:<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 return jsonify({&#039;error&#039;: e.output})<\/p>\n<p>if __name__ &#061;&#061; &#039;__main__&#039;:<\/p>\n<p>\u00a0 \u00a0 app.run(host&#061;&#039;0.0.0.0&#039;, port&#061;5000) <\/p>\n<p>\u6d4f\u89c8\u5668\u524d\u7aef&#xff1a;<\/p>\n<p>\u5728\u5185\u7f51\u4e2d\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684 HTML \u9875\u9762&#xff0c;\u63d0\u4f9b\u4ee3\u7801\u8f93\u5165\u6846\u548c\u8f93\u51fa\u663e\u793a\u533a\u57df&#xff0c;\u4f7f\u7528 JavaScript \u4e0e Flask \u540e\u7aef\u901a\u4fe1&#xff1a;<\/p>\n<p>html<\/p>\n<\/p>\n<p>&lt;!DOCTYPE html&gt;<\/p>\n<p>&lt;html&gt;<\/p>\n<p>&lt;body&gt;<\/p>\n<p>\u00a0 \u00a0 &lt;textarea id&#061;&#034;code&#034; rows&#061;&#034;10&#034; cols&#061;&#034;50&#034;&gt;disp(&#039;Hello, World!&#039;);&lt;\/textarea&gt;&lt;br&gt;<\/p>\n<p>\u00a0 \u00a0 &lt;button onclick&#061;&#034;runCode()&#034;&gt;\u8fd0\u884c&lt;\/button&gt;<\/p>\n<p>\u00a0 \u00a0 &lt;pre id&#061;&#034;output&#034;&gt;&lt;\/pre&gt;<\/p>\n<p>\u00a0 \u00a0 &lt;script&gt;<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 async function runCode() {<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 const code &#061; document.getElementById(&#039;code&#039;).value;<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 const response &#061; await fetch(&#039;http:\/\/&lt;\u670d\u52a1\u5668IP&gt;:5000\/run&#039;, {<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 method: &#039;POST&#039;,<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 headers: { &#039;Content-Type&#039;: &#039;application\/json&#039; },<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 body: JSON.stringify({ code })<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 });<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 const result &#061; await response.json();<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 document.getElementById(&#039;output&#039;).textContent &#061; result.output || result.error;<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 }<\/p>\n<p>\u00a0 \u00a0 &lt;\/script&gt;<\/p>\n<p>&lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt; <\/p>\n<p>\u5c06\u6b64 HTML \u6587\u4ef6\u90e8\u7f72\u5230 Apache\/Nginx \u7684 Web \u6839\u76ee\u5f55&#xff08;\u5982 \/var\/www\/html&#xff09;\u3002<\/p>\n<p>\u8c03\u8bd5\u65b9\u6cd5&#xff1a;<\/p>\n<p>\u5728 MATLAB \u4ee3\u7801\u4e2d\u6dfb\u52a0\u65e5\u5fd7\u8f93\u51fa&#xff08;\u5982 fprintf&#xff09;\u6216\u9519\u8bef\u6355\u83b7&#xff08;try-catch&#xff09;&#xff0c;\u901a\u8fc7\u6d4f\u89c8\u5668\u67e5\u770b\u7ed3\u679c\u3002<\/p>\n<p>\u5728 Flask \u4e2d\u8bb0\u5f55 MATLAB \u7684\u8f93\u51fa\u548c\u9519\u8bef\u65e5\u5fd7&#xff0c;\u5fc5\u8981\u65f6\u4fdd\u5b58\u5230\u6587\u4ef6\u3002<\/p>\n<p>\u4f18\u70b9&#xff1a;<\/p>\n<p>\u5b8c\u5168\u5728\u5185\u7f51\u8fd0\u884c&#xff0c;\u65e0\u9700\u5916\u90e8\u4f9d\u8d56\u3002<\/p>\n<p>\u652f\u6301\u52a8\u6001\u8f93\u5165\u548c\u8fd0\u884c MATLAB \u4ee3\u7801\u3002<\/p>\n<p>\u53ef\u6269\u5c55\u4e3a\u66f4\u590d\u6742\u7684\u8c03\u8bd5\u754c\u9762\u3002<\/p>\n<p>\u7f3a\u70b9&#xff1a;<\/p>\n<p>\u8c03\u8bd5\u529f\u80fd\u8f83\u4e3a\u57fa\u7840&#xff0c;\u65e0\u6cd5\u76f4\u63a5\u8bbe\u7f6e\u65ad\u70b9\u6216\u9010\u6b65\u6267\u884c\u3002<\/p>\n<p>\u9700\u8981\u624b\u52a8\u7ef4\u62a4 MATLAB \u548c Web \u670d\u52a1\u7684\u96c6\u6210\u3002<\/p>\n<p>\u9002\u7528\u573a\u666f&#xff1a;\u9002\u5408\u5feb\u901f\u6d4b\u8bd5\u548c\u8fd0\u884c MATLAB \u4ee3\u7801\u3002<\/p>\n<p>\u65b9\u6848 2&#xff1a;\u4f7f\u7528 MATLAB Engine API for Python<\/p>\n<p>\u53ef\u884c\u6027&#xff1a;\u4e2d\u5230\u9ad8<\/p>\n<p>\u63cf\u8ff0&#xff1a;\u901a\u8fc7 MATLAB Engine API for Python \u5728\u9e92\u9e9f\u670d\u52a1\u5668\u4e0a\u8c03\u7528 MATLAB&#xff0c;\u5e76\u7ed3\u5408 Web \u6846\u67b6\u5b9e\u73b0\u6d4f\u89c8\u5668\u8c03\u8bd5\u3002<\/p>\n<p>\u5b9e\u73b0\u6b65\u9aa4&#xff1a;<\/p>\n<p>\u5b89\u88c5 MATLAB Engine&#xff1a;<\/p>\n<p>\u5728 MATLAB \u5b89\u88c5\u76ee\u5f55\u4e0b\u627e\u5230 Engine API&#xff08;\u901a\u5e38\u5728 extern\/engines\/python&#xff09;&#xff0c;\u5b89\u88c5&#xff1a;<\/p>\n<p>bash<\/p>\n<p>cd \/path\/to\/matlab\/extern\/engines\/python<\/p>\n<p>sudo python3 setup.py install <\/p>\n<p>\u7f16\u5199 Flask \u5e94\u7528&#xff1a;<\/p>\n<p>python<\/p>\n<p>from flask import Flask, request, jsonify<\/p>\n<p>import matlab.engine<\/p>\n<p>app &#061; Flask(__name__)<\/p>\n<p>eng &#061; matlab.engine.start_matlab() # \u542f\u52a8 MATLAB \u5f15\u64ce<\/p>\n<p>&#064;app.route(&#039;\/run&#039;, methods&#061;[&#039;POST&#039;])<\/p>\n<p>def run_matlab():<\/p>\n<p>\u00a0 \u00a0 code &#061; request.json.get(&#039;code&#039;)<\/p>\n<p>\u00a0 \u00a0 try:<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 eng.eval(code, nargout&#061;0) # \u6267\u884c MATLAB \u4ee3\u7801<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 output &#061; eng.workspace[&#039;ans&#039;] if &#039;ans&#039; in eng.workspace else &#034;Done&#034;<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 return jsonify({&#039;output&#039;: str(output)})<\/p>\n<p>\u00a0 \u00a0 except Exception as e:<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 return jsonify({&#039;error&#039;: str(e)})<\/p>\n<p>if __name__ &#061;&#061; &#039;__main__&#039;:<\/p>\n<p>\u00a0 \u00a0 app.run(host&#061;&#039;0.0.0.0&#039;, port&#061;5000) <\/p>\n<p>\u6d4f\u89c8\u5668\u524d\u7aef&#xff1a;\u4e0e\u65b9\u6848 1 \u7c7b\u4f3c&#xff0c;\u90e8\u7f72\u4e00\u4e2a HTML \u9875\u9762\u8c03\u7528 Flask API\u3002<\/p>\n<p>\u8c03\u8bd5\u65b9\u6cd5&#xff1a;<\/p>\n<p>\u5728 MATLAB \u4ee3\u7801\u4e2d\u4f7f\u7528 disp \u6216 fprintf \u8f93\u51fa\u4e2d\u95f4\u53d8\u91cf\u3002<\/p>\n<p>\u901a\u8fc7 Python \u6355\u83b7 MATLAB \u7684\u5f02\u5e38\u5e76\u8fd4\u56de\u7ed9\u6d4f\u89c8\u5668\u3002<\/p>\n<p>\u4f18\u70b9&#xff1a;<\/p>\n<p>MATLAB Engine \u63d0\u4f9b\u66f4\u76f4\u63a5\u7684\u4ea4\u4e92&#xff0c;\u9002\u5408\u52a8\u6001\u8c03\u8bd5\u3002<\/p>\n<p>\u53ef\u8bbf\u95ee MATLAB \u5de5\u4f5c\u533a\u53d8\u91cf\u3002<\/p>\n<p>\u7f3a\u70b9&#xff1a;<\/p>\n<p>\u542f\u52a8 MATLAB \u5f15\u64ce\u8f83\u6162&#xff0c;\u4e14\u8d44\u6e90\u5360\u7528\u8f83\u9ad8\u3002<\/p>\n<p>\u8c03\u8bd5\u4ecd\u4f9d\u8d56\u8f93\u51fa\u65e5\u5fd7&#xff0c;\u65e0\u6cd5\u5b8c\u5168\u66ff\u4ee3 MATLAB IDE\u3002<\/p>\n<p>\u9002\u7528\u573a\u666f&#xff1a;\u9002\u5408\u9700\u8981\u8bbf\u95ee MATLAB \u5de5\u4f5c\u533a\u6216\u8fd0\u884c\u590d\u6742\u4ee3\u7801\u7684\u60c5\u51b5\u3002<\/p>\n<p>\u65b9\u6848 3&#xff1a;\u901a\u8fc7\u8fdc\u7a0b\u684c\u9762\u5de5\u5177&#xff08;VNC&#xff09;<\/p>\n<p>\u53ef\u884c\u6027&#xff1a;\u9ad8<\/p>\n<p>\u63cf\u8ff0&#xff1a;\u5728\u9e92\u9e9f\u670d\u52a1\u5668\u4e0a\u8fd0\u884c MATLAB&#xff0c;\u901a\u8fc7 VNC&#xff08;\u865a\u62df\u7f51\u7edc\u8ba1\u7b97&#xff09;\u5728\u6d4f\u89c8\u5668\u4e2d\u8bbf\u95ee\u5b8c\u6574\u7684 MATLAB \u684c\u9762\u73af\u5883\u3002<\/p>\n<p>\u5b9e\u73b0\u6b65\u9aa4&#xff1a;<\/p>\n<p>\u5b89\u88c5 VNC \u670d\u52a1&#xff1a;<\/p>\n<p>\u5b89\u88c5 VNC \u670d\u52a1\u5668&#xff08;\u5982 TigerVNC \u6216 TightVNC&#xff09;&#xff1a;<\/p>\n<p>bash<\/p>\n<p>sudo apt-get install tigervnc-standalone-server tigervnc-common <\/p>\n<p>\u914d\u7f6e VNC&#xff1a;<\/p>\n<p>bash<\/p>\n<p>vncserver<\/p>\n<p>\u8bbe\u7f6e\u5bc6\u7801\u5e76\u8bb0\u5f55\u663e\u793a\u7f16\u53f7&#xff08;\u5982 :1&#xff09;\u3002<\/p>\n<p>\u542f\u52a8 MATLAB&#xff1a;<\/p>\n<p>\u5728 VNC \u4f1a\u8bdd\u4e2d\u542f\u52a8 MATLAB&#xff1a;<\/p>\n<p>bash<\/p>\n<p>matlab &amp;<\/p>\n<p>\u6d4f\u89c8\u5668\u8bbf\u95ee&#xff1a;<\/p>\n<p>\u5728\u5ba2\u6237\u7aef\u8ba1\u7b97\u673a\u4e0a\u5b89\u88c5 VNC \u5ba2\u6237\u7aef&#xff08;\u5982 noVNC&#xff0c;\u4e00\u4e2a\u57fa\u4e8e HTML5 \u7684 VNC \u5ba2\u6237\u7aef&#xff09;\u3002<\/p>\n<p>\u914d\u7f6e noVNC \u5e76\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95ee\u670d\u52a1\u5668 IP \u548c\u7aef\u53e3&#xff08;\u5982 http:\/\/&lt;\u670d\u52a1\u5668IP&gt;:6080\/vnc.html&#xff09;\u3002<\/p>\n<p>\u8c03\u8bd5\u65b9\u6cd5&#xff1a;<\/p>\n<p>\u5728\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00\u7684 MATLAB \u754c\u9762\u4e0e\u684c\u9762\u7248\u4e00\u81f4&#xff0c;\u652f\u6301\u65ad\u70b9\u3001\u9010\u6b65\u6267\u884c\u3001\u53d8\u91cf\u68c0\u67e5\u7b49\u5b8c\u6574\u8c03\u8bd5\u529f\u80fd\u3002<\/p>\n<p>\u4f18\u70b9&#xff1a;<\/p>\n<p>\u63d0\u4f9b\u5b8c\u6574\u7684 MATLAB \u8c03\u8bd5\u4f53\u9a8c\u3002<\/p>\n<p>\u65e0\u9700\u989d\u5916\u5f00\u53d1&#xff0c;\u76f4\u63a5\u4f7f\u7528\u73b0\u6709\u5de5\u5177\u3002<\/p>\n<p>\u7f3a\u70b9&#xff1a;<\/p>\n<p>\u9700\u8981\u914d\u7f6e VNC \u548c\u56fe\u5f62\u754c\u9762&#xff0c;\u5360\u7528\u670d\u52a1\u5668\u8d44\u6e90\u8f83\u591a\u3002<\/p>\n<p>\u6d4f\u89c8\u5668\u4f53\u9a8c\u4f9d\u8d56\u7f51\u7edc\u5e26\u5bbd\u548c\u5ef6\u8fdf\u3002<\/p>\n<p>\u9002\u7528\u573a\u666f&#xff1a;\u9002\u5408\u9700\u8981\u5b8c\u6574\u8c03\u8bd5\u529f\u80fd\u4e14\u670d\u52a1\u5668\u786c\u4ef6\u652f\u6301\u56fe\u5f62\u754c\u9762\u7684\u60c5\u51b5\u3002<\/p>\n<p>\u63a8\u8350\u65b9\u6848<\/p>\n<p>\u6839\u636e\u4f60\u7684\u5185\u7f51\u73af\u5883\u548c\u9e92\u9e9f\u64cd\u4f5c\u7cfb\u7edf&#xff0c;\u6211\u63a8\u8350&#xff1a;<\/p>\n<p>\u65b9\u6848 1&#xff08;Web \u670d\u52a1\u5668 &#043; Flask&#xff09;&#xff1a;\u5b9e\u73b0\u7b80\u5355&#xff0c;\u9002\u5408\u5feb\u901f\u642d\u5efa\u8f7b\u91cf\u7ea7\u8c03\u8bd5\u73af\u5883\u3002<\/p>\n<p>\u65b9\u6848 3&#xff08;VNC&#xff09;&#xff1a;\u5982\u679c\u9700\u8981\u5b8c\u6574\u7684 MATLAB \u8c03\u8bd5\u529f\u80fd&#xff0c;\u4e14\u670d\u52a1\u5668\u652f\u6301\u56fe\u5f62\u754c\u9762&#xff0c;\u8fd9\u662f\u6700\u76f4\u63a5\u7684\u9009\u62e9\u3002<\/p>\n<p>\u6ce8\u610f\u4e8b\u9879<\/p>\n<p>\u9e92\u9e9f\u517c\u5bb9\u6027&#xff1a;\u786e\u8ba4 MATLAB \u548c\u6240\u9700\u5de5\u5177&#xff08;\u5982 Python\u3001VNC&#xff09;\u4e0e\u9e92\u9e9f\u7248\u672c\u517c\u5bb9&#xff0c;\u53ef\u80fd\u9700\u8981\u8c03\u6574\u8f6f\u4ef6\u6e90\u6216\u624b\u52a8\u5b89\u88c5\u3002<\/p>\n<p>\u6027\u80fd\u4f18\u5316&#xff1a;MATLAB \u5728\u65e0\u56fe\u5f62\u754c\u9762\u7684\u60c5\u51b5\u4e0b\u8fd0\u884c\u66f4\u9ad8\u6548&#xff08;\u5982 -nodisplay&#xff09;&#xff0c;\u4f46\u8c03\u8bd5\u53ef\u80fd\u9700\u8981 GUI\u3002<\/p>\n<p>\u5b89\u5168\u6027&#xff1a;\u5728\u5185\u7f51\u4e2d\u786e\u4fdd\u7aef\u53e3&#xff08;\u5982 Flask \u7684 5000 \u6216 VNC \u7684 5901&#xff09;\u4ec5\u9650\u6388\u6743\u7528\u6237\u8bbf\u95ee\u3002<\/p>\n<p>\u65e5\u5fd7\u8bb0\u5f55&#xff1a;\u5efa\u8bae\u5728\u670d\u52a1\u5668\u7aef\u6dfb\u52a0\u65e5\u5fd7\u529f\u80fd&#xff0c;\u4fbf\u4e8e\u6392\u67e5\u95ee\u9898\u3002<\/p>\n<p>\u5982\u679c\u9700\u8981\u66f4\u5177\u4f53\u7684\u5b89\u88c5\u6b65\u9aa4\u6216\u4ee3\u7801\u793a\u4f8b&#xff0c;\u8bf7\u544a\u8bc9\u6211\u4f60\u7684\u5177\u4f53\u9700\u6c42&#xff08;\u5982 MATLAB \u7248\u672c\u3001\u9e92\u9e9f\u7248\u672c\u7b49&#xff09;&#xff0c;\u6211\u53ef\u4ee5\u8fdb\u4e00\u6b65\u4f18\u5316\u65b9\u6848&#xff01;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e19\u6b21\uff0c\u6536\u85cf7\u6b21\u3002\u63cf\u8ff0\uff1a\u5728\u9e92\u9e9f\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u8fd0\u884c MATLAB\uff0c\u5e76\u901a\u8fc7\u4e00\u4e2a\u8f7b\u91cf\u7ea7 Web \u670d\u52a1\u5668\uff08\u5982 Apache \u6216 Nginx\uff09\u7ed3\u5408\u811a\u672c\u8bed\u8a00\uff08\u5982 Python Flask\uff09\u63d0\u4f9b\u6d4f\u89c8\u5668\u4ea4\u4e92\u548c\u8c03\u8bd5\u529f\u80fd\u3002MATLAB \u652f\u6301\uff1a\u5047\u8bbe\u670d\u52a1\u5668\u4e0a\u5df2\u5b89\u88c5 MATLAB\uff08\u9e92\u9e9f\u7cfb\u7edf\u652f\u6301 MATLAB \u7684 Linux \u7248\u672c\uff0c\u5982 R2023b \u6216\u66f4\u65e9\u7248\u672c\uff09\u3002\u63cf\u8ff0\uff1a\u5728\u9e92\u9e9f\u670d\u52a1\u5668\u4e0a\u8fd0\u884c MATLAB\uff0c\u901a\u8fc7 VNC\uff08\u865a\u62df\u7f51\u7edc\u8ba1\u7b97\uff09\u5728\u6d4f\u89c8\u5668\u4e2d\u8bbf\u95ee\u5b8c\u6574\u7684 MATLAB \u684c\u9762\u73af\u5883\u3002_\u9e92\u9e9f\u64cd\u4f5c\u7cfb\u7edf \u5b89\u88c5 matlab<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[375,376,100],"topic":[],"class_list":["post-9774","post","type-post","status-publish","format-standard","hentry","category-server","tag-hla-","tag-linux-","tag-100"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u9e92\u9e9f\u64cd\u4f5c\u7cfb\u7edf\u4f5c\u4e3a\u670d\u52a1\u5668\uff0c\u5e76\u4e14\u9700\u8981\u5728\u6d4f\u89c8\u5668\u4e0a\u8c03\u8bd5 MATLAB - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/9774.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u9e92\u9e9f\u64cd\u4f5c\u7cfb\u7edf\u4f5c\u4e3a\u670d\u52a1\u5668\uff0c\u5e76\u4e14\u9700\u8981\u5728\u6d4f\u89c8\u5668\u4e0a\u8c03\u8bd5 MATLAB - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e19\u6b21\uff0c\u6536\u85cf7\u6b21\u3002\u63cf\u8ff0\uff1a\u5728\u9e92\u9e9f\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u8fd0\u884c MATLAB\uff0c\u5e76\u901a\u8fc7\u4e00\u4e2a\u8f7b\u91cf\u7ea7 Web \u670d\u52a1\u5668\uff08\u5982 Apache \u6216 Nginx\uff09\u7ed3\u5408\u811a\u672c\u8bed\u8a00\uff08\u5982 Python Flask\uff09\u63d0\u4f9b\u6d4f\u89c8\u5668\u4ea4\u4e92\u548c\u8c03\u8bd5\u529f\u80fd\u3002MATLAB \u652f\u6301\uff1a\u5047\u8bbe\u670d\u52a1\u5668\u4e0a\u5df2\u5b89\u88c5 MATLAB\uff08\u9e92\u9e9f\u7cfb\u7edf\u652f\u6301 MATLAB \u7684 Linux \u7248\u672c\uff0c\u5982 R2023b \u6216\u66f4\u65e9\u7248\u672c\uff09\u3002\u63cf\u8ff0\uff1a\u5728\u9e92\u9e9f\u670d\u52a1\u5668\u4e0a\u8fd0\u884c MATLAB\uff0c\u901a\u8fc7 VNC\uff08\u865a\u62df\u7f51\u7edc\u8ba1\u7b97\uff09\u5728\u6d4f\u89c8\u5668\u4e2d\u8bbf\u95ee\u5b8c\u6574\u7684 MATLAB \u684c\u9762\u73af\u5883\u3002_\u9e92\u9e9f\u64cd\u4f5c\u7cfb\u7edf \u5b89\u88c5 matlab\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/9774.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T09:37:24+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/9774.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/9774.html\",\"name\":\"\u9e92\u9e9f\u64cd\u4f5c\u7cfb\u7edf\u4f5c\u4e3a\u670d\u52a1\u5668\uff0c\u5e76\u4e14\u9700\u8981\u5728\u6d4f\u89c8\u5668\u4e0a\u8c03\u8bd5 MATLAB - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T09:37:24+00:00\",\"dateModified\":\"2025-04-18T09:37:24+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/9774.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/9774.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/9774.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u9e92\u9e9f\u64cd\u4f5c\u7cfb\u7edf\u4f5c\u4e3a\u670d\u52a1\u5668\uff0c\u5e76\u4e14\u9700\u8981\u5728\u6d4f\u89c8\u5668\u4e0a\u8c03\u8bd5 MATLAB\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u9e92\u9e9f\u64cd\u4f5c\u7cfb\u7edf\u4f5c\u4e3a\u670d\u52a1\u5668\uff0c\u5e76\u4e14\u9700\u8981\u5728\u6d4f\u89c8\u5668\u4e0a\u8c03\u8bd5 MATLAB - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/9774.html","og_locale":"zh_CN","og_type":"article","og_title":"\u9e92\u9e9f\u64cd\u4f5c\u7cfb\u7edf\u4f5c\u4e3a\u670d\u52a1\u5668\uff0c\u5e76\u4e14\u9700\u8981\u5728\u6d4f\u89c8\u5668\u4e0a\u8c03\u8bd5 MATLAB - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e19\u6b21\uff0c\u6536\u85cf7\u6b21\u3002\u63cf\u8ff0\uff1a\u5728\u9e92\u9e9f\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u8fd0\u884c MATLAB\uff0c\u5e76\u901a\u8fc7\u4e00\u4e2a\u8f7b\u91cf\u7ea7 Web \u670d\u52a1\u5668\uff08\u5982 Apache \u6216 Nginx\uff09\u7ed3\u5408\u811a\u672c\u8bed\u8a00\uff08\u5982 Python Flask\uff09\u63d0\u4f9b\u6d4f\u89c8\u5668\u4ea4\u4e92\u548c\u8c03\u8bd5\u529f\u80fd\u3002MATLAB \u652f\u6301\uff1a\u5047\u8bbe\u670d\u52a1\u5668\u4e0a\u5df2\u5b89\u88c5 MATLAB\uff08\u9e92\u9e9f\u7cfb\u7edf\u652f\u6301 MATLAB \u7684 Linux \u7248\u672c\uff0c\u5982 R2023b \u6216\u66f4\u65e9\u7248\u672c\uff09\u3002\u63cf\u8ff0\uff1a\u5728\u9e92\u9e9f\u670d\u52a1\u5668\u4e0a\u8fd0\u884c MATLAB\uff0c\u901a\u8fc7 VNC\uff08\u865a\u62df\u7f51\u7edc\u8ba1\u7b97\uff09\u5728\u6d4f\u89c8\u5668\u4e2d\u8bbf\u95ee\u5b8c\u6574\u7684 MATLAB \u684c\u9762\u73af\u5883\u3002_\u9e92\u9e9f\u64cd\u4f5c\u7cfb\u7edf \u5b89\u88c5 matlab","og_url":"https:\/\/www.wsisp.com\/helps\/9774.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T09:37:24+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/9774.html","url":"https:\/\/www.wsisp.com\/helps\/9774.html","name":"\u9e92\u9e9f\u64cd\u4f5c\u7cfb\u7edf\u4f5c\u4e3a\u670d\u52a1\u5668\uff0c\u5e76\u4e14\u9700\u8981\u5728\u6d4f\u89c8\u5668\u4e0a\u8c03\u8bd5 MATLAB - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T09:37:24+00:00","dateModified":"2025-04-18T09:37:24+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/9774.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/9774.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/9774.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u9e92\u9e9f\u64cd\u4f5c\u7cfb\u7edf\u4f5c\u4e3a\u670d\u52a1\u5668\uff0c\u5e76\u4e14\u9700\u8981\u5728\u6d4f\u89c8\u5668\u4e0a\u8c03\u8bd5 MATLAB"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/9774","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=9774"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/9774\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=9774"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=9774"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=9774"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=9774"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}