Functional differences
ID | MCC-8 |
Title | The use of functions with (potential) different behaviour when deployed, shall be avoided. |
Priority | Recommended |
Severity level | 6 |
Description | The use of functions with (potential) different behaviour when deployed, shall be avoided if possible. Otherwise their use needs manual review for documented reasons. |
Rationale | Portability |
manual review required
The following table shows the reviewing aspect.
Function | Rationale for review | Doc |
---|---|---|
help | MATLAB file comments are stripped out before MATLAB Runtime encryption. Note: actual behaviour seen in R2022b is a runtime error! | link |
printdlg | In compiled mode, only one argument can be present in a call to printdlg | link |
which | In compiled mode, which does not search the current folder. | link |
open | In compiled mode, open does not search the current folder. | link |
pwd | When compiled, the start directory of an application is context-specific, so using pwd might result in unexpected values. | |
matlabroot | Alternative 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. | |
isfile | isfile(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. | |
isfolder | isfolder(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. |