how to find specific .mat file
8 views (last 30 days)
Show older comments
If I know the name of the mat file,can I find it in toolbox?But I do not know which category it is and is seems only functions can be found there.
0 Comments
Accepted Answer
More Answers (1)
Walter Roberson
on 16 Jun 2018
>> which handel.mat
/Applications/MATLAB_R2018a.app/toolbox/matlab/audiovideo/handel.mat
3 Comments
Walter Roberson
on 16 Jun 2018
You would name the .mat file you wanted to find instead of handel.mat . For example,
which flu.mat
In order for which to be able to find the .mat file, it must be somewhere on the MATLAB path.
If the file is in a private directory or inside a package, then the directory is probably not directly on the MATLAB path. In such a case you case use the -all flag of which:
>> which new_btn.mat
'new_btn.mat' not found.
>> which -all new_btn.mat
/Applications/MATLAB_R2018a.app/toolbox/stateflow/stateflow/private/new_btn.mat
However, not all files provided with MATLAB are on the MATLAB path. For example some of the files related to examples are not on the path by default, and when you use open_example then they are copied from their location to a local directory for you to experiment with. You might need to use a system tool to find the file
>> which -all flames.mat
'flames.mat' not found.
>> !find /Applications/MATLAB_R2018a.app -name flames.mat -print
/Applications/MATLAB_R2018a.app/extern/examples/compiler/flames.mat
In MS Windows, the command would involve "dir" with the "/s" flag, such as
!cd C:\; dir /s flames.mat
See Also
Categories
Find more on File Operations 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!