Troubleshooting custom files solution

4 ビュー (過去 30 日間)
Ally Wesner
Ally Wesner 2020 年 6 月 3 日
回答済み: Divyam 2025 年 6 月 12 日
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 Center および File ExchangeDevelop 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