How can I create P-code for main script along with their sub-scripts?

Hi,
How can I create P-code for main script along with their sub-scripts?
I am calling all subscripts in main scirpt.

 採用された回答

Wan Ji
Wan Ji 2021 年 8 月 16 日
You can make main file like this
function main()
% main file body
end
function fun1()
% fun1
end
function fun2()
% fun2
end
...
Then pcode your main file!

3 件のコメント

Walter Roberson
Walter Roberson 2021 年 8 月 16 日
According to a differnet question they posted near the same time, it is important that they use scripts.
(They are writing everything into the base workspace so they would have a bunch of rewriting to do in order to use functions.)
Wan Ji
Wan Ji 2021 年 8 月 16 日
If so, pcode all the scripts in a file folder is not a difficult thing. In the current file folder, do
a = dir('.\*.m');
arrayfun(@(i)pcode(a(i).name), 1:1:numel(a));
Walter Roberson
Walter Roberson 2021 年 8 月 16 日
pcode accepts wildcards and folder names.
However by itself it does not analyze functions or scripts to figure out what is called, especially not from other directories.

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

その他の回答 (0 件)

カテゴリ

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

製品

リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by