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

조회 수: 2 (최근 30일)
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
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개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by