Troubleshooting custom files solution
3 views (last 30 days)
Show older comments
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 Comments
Chi
on 14 Jun 2022
Edited: Chi
on 15 Jun 2022
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.
Answers (1)
Divyam
on 12 Jun 2025
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
0 Comments
See Also
Categories
Find more on Develop Apps Using App Designer in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!