Friday, 15 January 2010

applying difference set operation in matlab? -


I have 23 sentences that I extracted from the text file and 6 most frequent words were removed from the same text file. is. I have applied the argument that shows which sentence in which the word actually happened with the second set of other words, in which the code of sentences and the logic argument excluded is shown:

  OccursTogether = Cell (length (out1)); For Ii = 1: JJ = I + 1: decreases the length (out 1) for length (out 1) together {ii, jj} = intersection (out 1 {ii}, out 1 {j j}}; Out 1 is 1D array which shows the words and in which sentences the number is generated I have applied the interval of the set interval, but the result was not obtained for which I wanted. As shown in:  
  Sentence = regexp (F, '\ s. *? [\. \! \?]', ' Match four) (sentence)  

By following I find that 1 sentence occurs in number 5 with the self, with 1 word sentence 5 and 6 with another word And similarly: ..

  occursstogether {1,1} = 5 occurstogether {1,2} = 5 6 occurstogether {1,3} = 6 9 20 and so on .. ..  

What do I want to do, to find out that these words are not together:, 2} = 1 2 3 4 7, ... 23 impotent { 1,3} = 1 2 3 4 5 7 8 10 ... 22

Remember these 1,2, 3, .. 23 are the number of sentences Which contains a pair of words and where they are not together, shows the output to them empty {}

Try it:

  occursstogether {1,1} = [5]; By occurring {1,2} = [5 6]; By occurring {1,3} = [6 9 20]; N = 23; Result = cellphone (@ (x) setdif (1: n, x), together, 'uniform output', 0); In each cell of  

results will be not recursive with the sorted vector, according to . If you want to change that behavior, see the option of set .


No comments:

Post a Comment