Is there any function that similar like CELLFUN, for a TABLE Dataype
25 次查看(过去 30 天)
显示 更早的评论
Following my earlier thread "Modified the CELL'S column number into words", I had to change the data representation from CELL into TABLE type. However, this new changes make part of the code not working. In the earlier version of the code, the following lines were used to access parts of the cells that satisfying the three conditions.
valid = find(cellfun('isclass', at.PatData(:, 1), 'char') & ...
cellfun('isclass', at.PatData(:, 2), 'char') & ...
cellfun('isclass', at.PatData(:, 3), 'char'));
Since, the data was represent in a new form,TABLE type. Obviously, the above line is not working. Thus, I plan to change it accordingly. However, I am unable to find any build in function that similar to CELLFUN, for a table datatype. I do not know whether I use the wrong keyword or such function is in fact not available at all.
The complete code and mat file are attached together in this thread.
Thanks in advance
0 个评论
采纳的回答
更多回答(1 个)
Peter Perkins
2017-7-27
It's not clear what you code is doing, or what you're using the output for. It appears that your code is finding rows of an Nx3 cell array in which all three cells contains a char array. Also just guessing again, but it looks like maybe you are converting that cell array into a table using cell2table, and because all the columns contain both chars and numbers, the result is a table all of whose variables are cell arrays containing both chars and numbers. And then whatever you are trying to do with varfun errors because hardly anything, including unique, does anything useful on a cell array that contains both numbers and chars.
I think you need to step back and rethink whatever you are doing.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!