FINDCELL.M
资源名称:speech.rar [点击查看]
上传用户:ay_070428
上传日期:2014-12-04
资源大小:11427k
文件大小:1k
源码类别:
语音合成与识别
开发平台:
Matlab
- function index = findcell(cell_str, pattern)
- % FINDCELL "find" for cell arrays of strings
- % Usage:
- % INDEX = FINDCELL(CELL, PATTERN)
- % CELL: cell array of strings to be searched
- % PATTERN: searched string (which could be [])
- % INDEX: indices of matched cell
- % Roger Jang, 981107
- index = [];
- if isempty(pattern),
- for i = 1:length(cell_str),
- if isempty(cell_str{i}),
- index = [index, i];
- end
- end
- else
- for i = 1:length(cell_str),
- if strcmp(cell_str{i}, pattern),
- index = [index, i];
- end
- end
- end