フィルターのクリア

Is there any function that similar like CELLFUN, for a TABLE Dataype

25 ビュー (過去 30 日間)
balandong
balandong 2017 年 7 月 26 日
回答済み: balandong 2017 年 8 月 2 日
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

採用された回答

balandong
balandong 2017 年 8 月 2 日
Dear all
Turn out, using TABLE type is more flexible and easier. The above problem was solved using
valid = find((at.sub.Condition == cond_Cond) & (at.sub.Shiftday == cond_SD) ); % work
Valindex = valid((strcmp(at.sub.ID(valid,1),cond_Sbj)));
For those new to table, please see Table.
Problem SOLVED

その他の回答 (1 件)

Peter Perkins
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.
  1 件のコメント
balandong
balandong 2017 年 7 月 29 日
Hi Peter, Thanks for the reply, do you manage to check the full code attached together in this thread. I include some comment in the code.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by