MATLAB Answers

0

Using wildcard character in system command

Asked by Rashmil Dahanayake on 7 Aug 2014
Latest activity Answered by Star Strider
on 7 Aug 2014
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

  0 Comments

Sign in to comment.

Products

1 Answer

Answer by Star Strider
on 7 Aug 2014

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

  0 Comments

Sign in to comment.