Use Compiler to Deploy Code on Remote Unix Machine

3 ビュー (過去 30 日間)
Juan Ramirez
Juan Ramirez 2018 年 5 月 24 日
コメント済み: Walter Roberson 2018 年 5 月 25 日
I would like to deploy MATLAB code on a remote unix machine that reads an input file and outputs a few output files. This is my first time deploying. How do I accomplish this? For simplicity, main.m contains a function which takes 2 arguments: 1) an input filename and 2) the path of a directory for saving the output files. And say I have a helper file fcn.m.
What are the steps for building the deployed code and executing it for a given input filename and output directory path?

採用された回答

OCDER
OCDER 2018 年 5 月 24 日
To compile the code, use mcc in MATLAB. It'll include your fcn.m file IF that file is in the MATLAB path.
>> mcc -m main.m
%This'll generate some files and one that's run_main.sh
To execute in the UNIX machine, you'll have to do something like this:
UNIX/your_path]$ ./run_main.sh mcr_path input1 input2
mcr_path = where the MATLAB Runtime library is in the Unix machine
input1 = your main.m 1st input
input2 = your main.m 2nd input
WARNING: you must compile the main.m code with the same OS and the same MATLAB Runtime Library version as what's on the UNIX machine. You can't compile in Windows and let it run in Unix. The workaround is to compile in Unix.
  2 件のコメント
Juan Ramirez
Juan Ramirez 2018 年 5 月 25 日
編集済み: Juan Ramirez 2018 年 5 月 25 日
Thank you for the answer! That's disappointing about compiling on the same platform :(
Maybe compiling for UNIX on a windows machine can be done within Cygwin.
Walter Roberson
Walter Roberson 2018 年 5 月 25 日
mcc does not support using Cygwin as a toolchain.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Compiler についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by