Troubleshooting custom files solution

4 次查看(过去 30 天)
Suppose a user receives an error when attempting to use "pdf" function from the Statistics and Machine Learning Toolbox. However, you do not receive the same error when using this function with the same input arguments. What single line of code will help you determine if the user has his/her own "pdf" function?
  3 个评论
Ally Wesner
Ally Wesner 2020-6-4
What would be the exact command for checking the pdf function using "which"?
Chi
Chi 2022-6-14
编辑:Chi 2022-6-15
Acceptable answer at the time of this post would be "which pdf -all". It would display path to all pdf functions on the search path and therefore it help to check if user has his/her own pdf function. See documentation on which ___ -all for more information.

请先登录,再进行评论。

回答(1 个)

Divyam
Divyam 2025-6-12
As mentioned in the comments above, you need to execute the command below to display the path to all the pdf functions on the search path of your MATLAB installation.
which pdf -all
To figure out which search path is referencing your custom pdf, you need to parse the locations listed after the execution of the above command and check that the top result should not be the path to a built-in MATLAB function. The path should point to a MATLAB workspace or any other location on your system's home directory that is not a part of the MATLAB installation directory.
/home/user/matlab/pdf.m % custom function
matlab/toolbox/stats/.../pdf.m % built-in function
For more information regarding the "which" function, refer to the following documentation: https://www.mathworks.com/help/matlab/ref/which.html

类别

Help CenterFile Exchange 中查找有关 Develop Apps Using App Designer 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by