dir problems

1 次查看(过去 30 天)
zhang
zhang 2011-9-14
编辑: Stephen23 2016-9-3
Hi guys
In my project, one of the functions needs to use "dir". It gives me the following error: Index exceeds matrix dimensions.
However, the "dir" works well outside of my project.
I beg you guys' suggestions.
Thanks,
  3 个评论
zhang
zhang 2011-9-14
test = dir('C:\myproject\UAIS\data\binaryKinectDataOfUAIS\zhong\view1\rgb\*.bin');
Both in the project and out the project.
Fangjun Jiang
Fangjun Jiang 2011-9-14
When you run that line in MATLAB Command Window, what did you get?

请先登录,再进行评论。

回答(1 个)

Sean de Wolski
Sean de Wolski 2011-9-14
It means inside the function you defined a variable as dir.
dbstop if error
Now run your function, it'll blow up
who dir %dir will be a variable
  3 个评论
Vishnu Narang
Vishnu Narang 2016-9-2
I faced the same issue. i've updated the code but it still gives the error. There is no variable named dir now. Is there anything in matlab to clear cache or something of those sorts to get it working?
Stephen23
Stephen23 2016-9-3
编辑:Stephen23 2016-9-3
@Vishnu Narang: clear dir or restart MATLAB. And don't use the names of inbuilt MATLAB functions!

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 File Operations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by