dir problems

3 visualizaciones (últimos 30 días)
zhang
zhang el 14 de Sept. de 2011
Editada: Stephen23 el 3 de Sept. de 2016
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 comentarios
zhang
zhang el 14 de Sept. de 2011
test = dir('C:\myproject\UAIS\data\binaryKinectDataOfUAIS\zhong\view1\rgb\*.bin');
Both in the project and out the project.
Fangjun Jiang
Fangjun Jiang el 14 de Sept. de 2011
When you run that line in MATLAB Command Window, what did you get?

Iniciar sesión para comentar.

Respuestas (1)

Sean de Wolski
Sean de Wolski el 14 de Sept. de 2011
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 comentarios
Vishnu Narang
Vishnu Narang el 2 de Sept. de 2016
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 el 3 de Sept. de 2016
Editada: Stephen23 el 3 de Sept. de 2016
@Vishnu Narang: clear dir or restart MATLAB. And don't use the names of inbuilt MATLAB functions!

Iniciar sesión para comentar.

Categorías

Más información sobre File Operations en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by