【发布时间】:2013-03-15 05:39:56
【问题描述】:
我有一个名为 list 的单元格数组,其中包含一个文件列表。我想只从该列表中提取特定文件并将它们存储在同一个数组中。这是我想要做的:
function [ varargout ] = myFiles( varargin )
list = {'test.m' '.' '..' 'test1.m' 'test2.txt'};
list = strmatch('*.m', list)
end
我的最终列表应该如下所示,但是索引应该足够了。
list = test.m test1.m
我在 Windows 上使用 MATLAB。在双引号中使用模式会引发错误。 也尝试使用 \\'s 作为 (.) 和/或 (*) 的转义序列。
【问题讨论】: