counting letters in a cell "matlab" -
One of the above codes will count the number of characters in a cell that I like it
[Exclusive C, ~, IDX] = Unique (chromatic); Unique entries in% # unique CC% #, if first-R2008a calculation = deposit (idx (:), 1, [], @ yoga); Tilde changes with 'Dummy'; But there is a blog: My cell contains letters from E to one I do not want to find any of the 'A' B ... this code will not tell that there ' E 'if it is not available. 4 would be calculated instead of just 5
1 2 2 3 and not
1 2 2 3 0 How to do I have added
a = 1b = 2 ......
You can use it instead of resolving it:
characterCell = {'a' 'b' 'b' 'a' 'b' 'd' c '' c '} ; % # Sample cell array mailsel = {'a' 'b' 'c' 'd' 'e'}; Letter to count #% [~, index] = icemember (character cell, matchale); Find index in% # match, cell calculation = submit (index (:), 1, [nuzeil (mesh) 1]); The% signaling index and you should get the following for the calculations : calculation = 2 3 2 1 0 < / If I understand your comment correctly, it seems that you want to store or display letters with the number of your data. One way to do this is to first convert a <-ron into a cell array in a 5-by-2 cell array: & gt; & Gt; Results [= Mail (Mail) (Mail Number) (Mail) (Results) = 'A' [2] 'B' [3] 'C' [2] 'D' [1] 'E' [0] or you can change the number of to in a string: & gt; & Gt; Result = Triangle (Four (Mail (Mail) (')', ':', Number 2str (counting)) Results = a: 2 b: 3 c: 2 d: 1 e: 0
Comments
Post a Comment