Functional differences

IDMCC-8
TitleThe use of functions with (potential) different behaviour when deployed, shall be avoided.
PriorityRecommended
Severity level6
DescriptionThe use of functions with (potential) different behaviour when deployed, shall be avoided if possible. Otherwise their use needs manual review for documented reasons.
RationalePortability

manual review required

The following table shows the reviewing aspect.

FunctionRationale for reviewDoc
helpMATLAB file comments are stripped out before MATLAB Runtime encryption.
Note: actual behaviour seen in R2022b is a runtime error!
link
printdlgIn compiled mode, only one argument can be present in a call to printdlglink
whichIn compiled mode, which does not search the current folder.link
openIn compiled mode, open does not search the current folder.link
pwdWhen compiled, the start directory of an application is context-specific, so using pwd might result in unexpected values.
matlabrootAlternative to matlabroot, ctfroot can be usefull, but any folder operation should be programmed with care. For more information on ctfroot see MathWorks documentation. Also note the following Answer.
isfileisfile(fileName) returns 1 if fileName is a file located on the specified path or in the current folder. Otherwise, isfile returns 0.
Therefore, if the current folder in deployed mode is different, the result may be different, in case relative paths are used.
isfolderisfolder(folderName) returns 1 if folderName is a folder located on the specified path or in the current folder. Otherwise, isfolder returns 0.
Therefore, if the current folder in deployed mode is different, the result may be different, in case relative paths are used.