How do I extract a row of data from a cell array?
56 次查看(过去 30 天)
显示 更早的评论
I have a 3 x 4 cell array, (a), that looks like this;
'Due' 55000 1 100
'WFR' 55100 2 200
'Due' 55200 20 300
where column 1 is of char, and the others are doubles.
I'm attempting to extract the rows of data based on the values in the 3rd column being greater than 2 (20 in this case).
Desired output is cell b = 'Due' 55200 20 300
I'm using the following code;
b=a(~ismember(a(:, 3), [1 2]), :);
I keep getting the following error message;
"Input A of class cell and input B of class double must be cell arrays of strings, unless one is a string"
This is the first time I've attempted to extract rows of data from cell arrays. Am I doing something wrong? If so, how do I approach this problem in order to get b?
0 个评论
采纳的回答
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Whos 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!