how to check whether variable is directory
显示 更早的评论
I don't know whether a variable is a directory or not, but when I use exist or isdir, and it is not a directory, I get a fatal error.
回答(1 个)
Walter Roberson
2016-4-23
Variables cannot be directories. Variables can be strings that name directories. Example:
Testvar = 'data7'
exist(Testvar,'dir')
类别
在 帮助中心 和 File Exchange 中查找有关 Search Path 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!