Understanding Cell Array Indices
显示 更早的评论
I have a large cell array imported from a .csv file which contains numbers and strings. I am trying to use the index of a matching string to give me a row or column for the corresponding data. I am able to identify the string and it's "index" using the following:
TEXT={'103.9685,10:27:37,2016-02-03','103.9685,12:00:00,2016-01-03' '103.9685,11:27:37,2016-02-03' '103.9685,12:00:00,2016-02-03' };
%
ARRAY = cellfun(@(x)~isempty(strfind(x,'12:00:00')), TEXT);
%
INDICES = find(ARRAY(:) > 0
The challenge that I have is that this code gives me a single value index, at a value that doesn't make sense for either my number of rows or columns. Can somebody help me understand what this index value means, and how I might go about using it to find my row or column number that I'm originally looking for.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!