Why doesn't Matlab understand * in file names?

I tried using:

dir('dirname\*')

and it didn’t work. It started working after I started using:

dir('dirname\m*')

Does anyone know why?

+3
source share
3 answers

Matlab really understands wildcards *, but in the sense that you're out of luck to adhere to the conditional restrictions of Windows cmd, you entered a string \*that is a literal asterisk (due to the backslash).

A workaround or preferred way of specifying paths on all platforms is to use a slash /as a directory selector.

dir('dirname/*')

, m "" ; , .

EDIT: , (. ).

+7

? , Windows, . , "*", , Matlab "*". dir('dirname/*')?

0

Try providing the full path, for example dir ('c: \ dirname * .m'), and make sure the folder 'dirname' exists.

0
source

All Articles