Using wildcard character in system command

3 次查看(过去 30 天)
I'm using 2012b Release & having problem with using wildcard symbol(*) with a system command.
eg:
>> [status ,out]=system('dir *.mat')
status =
1
out =
Directory of C:\Users\sample\Documents\MATLAB
File Not Found
Similarly the inbuilt matlab function has the same error
dir('*.mat')
'*.mat' not found.
However it works When the *. portion is removed

回答(1 个)

Star Strider
Star Strider 2014-8-7
Both:
[status ,out]=system('dir *.mat')
and:
A = dir('*.mat')
work in R2014a. Without the ‘*.’ wildcard, it fails in both.

类别

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