How to publishing script with function

3 Ansichten (letzte 30 Tage)
Harry Spratt
Harry Spratt am 16 Apr. 2020
Beantwortet: Jakob B. Nielsen am 16 Apr. 2020
Is there any way to not run the code on certain sections but still publish the script? For instance is there any way to run all the code but not the function?

Antworten (1)

Jakob B. Nielsen
Jakob B. Nielsen am 16 Apr. 2020
Your question is a little vague, but if you mean what I think you mean - namely to compile a script but for the compiled version to only run part of your original script - then you can simply use the isdeployed function. In practical terms it is often easier to use a "is not deployed" syntax.
if ~isdeployed
% run this part if not deployed
else
% when deployed, only run this part.
end

Kategorien

Mehr zu MATLAB Code Analysis finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by