MATLAB Answers

How to check the algorithm of the internal functions?

74 views (last 30 days)
Yuantong Li
Yuantong Li on 19 Dec 2020
Commented: Yuantong Li on 21 Dec 2020
I am trying to figure out the internal algorithm of "stft()". I typed "edit stft" at command window. Then I got the whole script of "stft()". However, there is another internal function called "computeDFT" (as showed in the picture 1). With the help of the command "edit computeDFT" I can not get access of this function (as showed in the picture 2). Does anybody know how to check the whole script of the function "computeDFT()" here?
(picture 1)
(picture 2)
Many Thanks!
Yuantong Li
Yuantong Li on 21 Dec 2020
By right klicking on "computeDFT" I got the code I wanted. Thanks for your all helping!

Sign in to comment.

Accepted Answer

Steven Lord
Steven Lord on 20 Dec 2020
computeDFT is a private function in the same directory as the stft.m file. As such it is intended only be called by code in that same directory. If you select the call in that file, right-click on it, and select to open the file MATLAB will look for that function "in the context of stft" which is in the directory that can access the private function.
If you were hoping to call computeDFT in your code that is not possible unless it is in the toolbox directory, and I strongly recommend against you putting your own code in the toolbox directory (or indeed any directory under matlabroot.) This private function is not intended to be called by users directly.
  1 Comment
Yuantong Li
Yuantong Li on 21 Dec 2020
Thank you very much! Right klick on "computeDFT" --> "open "computeDFT"" --> I got the script!

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!