exist function says directory figures exists when it doesn't

8 次查看(过去 30 天)
For some reason, even though the directory figures does not exist, the command
exist('figures','dir')
is returning a 7 instead of a zero. I assumed this had to be something to do with my startup setup, but it appears not to be.
Could somebody explain why this is happening please?
I'm running R2019b on ubuntu 18.04
  2 个评论
Stephen23
Stephen23 2020-8-5
"The doc on exist doesn't make it clear that it searches the entire Matlab path..."
https://www.mathworks.com/help/matlab/ref/exist.html: "MATLAB searches starting at the top of the search path, and moving down until a result is found..."

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2020-8-5
Use isfolder(), R2017b or later. isfolder() does not search along the MATLAB search path.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Search Path 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by