Is there any function that similar like CELLFUN, for a TABLE Dataype
25 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
balandong
le 26 Juil 2017
Réponse apportée : balandong
le 2 Août 2017
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 commentaires
Réponse acceptée
Plus de réponses (1)
Peter Perkins
le 27 Juil 2017
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.
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!