Calling a script from a script

Hello,
I have four different scripts called:
graph1.m
graph2.m
graph3.m
graph4.m
How do I create a general script that will compile and execute these four scrips at one time?
Thank You

2 件のコメント

Daniel Shub
Daniel Shub 2012 年 1 月 9 日
What do you mean when you say compile? Do you just want them to run or do you want a stand alone executable file that you can take to another machine that doesn't have MATLAB installed?
Oleg Komarov
Oleg Komarov 2012 年 1 月 9 日
This is a job for inscription!

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

回答 (2 件)

Image Analyst
Image Analyst 2011 年 12 月 18 日

2 投票

Just list them along with any input or output arguments that they have, but without the .m. Like in this master m-file
allgraphs.m might contain
graph1;
output2 = graph2(42);
graph3;
graph4(69);
Then compile:
mcc -m allgraphs.m

2 件のコメント

Alexander Kosenkov
Alexander Kosenkov 2012 年 1 月 9 日
If graph2 is a script, it can not accept nor input nor output parameters. Otherwise - it is that easy, just type four names and all scripts will be called.
Walter Roberson
Walter Roberson 2012 年 1 月 9 日
Though as scripts cannot be compiled, allgraphs would have to become a function,
function allgraphs
graph1;
graph2;
graph3;
graph4;

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

Walter Roberson
Walter Roberson 2011 年 12 月 18 日

0 投票

It is not clear to me that scripts can be compiled using the MATLAB Compiler. I thought I had seen someone from MathWorks saying that it was possible these days, but I have not been able to find the discussion I was thinking of, and the documentation does specifically say that scripts cannot be compiled.

カテゴリ

ヘルプ センター および File ExchangeStartup and Shutdown についてさらに検索

製品

質問済み:

2011 年 12 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by