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!