Get the value of property from bagOfWords

1 次查看(过去 30 天)
Hi,
I have got following bagOfWords and need to extract the number of words into an arrary. How is that possible?
bagOfWords with properties:
Counts: [1×68 double]
Vocabulary: [1×68 string]
NumWords: 68
NumDocuments: 1
Thanks in advance
  3 个评论
Phil_911
Phil_911 2020-7-15
docum is a sting with 68 words and the code for bOW is the follwoing:
bag = bagOfWords(docum)
And the result is as stated:
bag =
bagOfWords with properties:
Counts: [1×68 double]
Vocabulary: [1×68 string]
NumWords: 68
NumDocuments: 1
Thanks in advance.
Phil_911
Phil_911 2020-7-15
And I need to extract the value 68 of the bag of Words for further calculations.

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2020-7-15
  2 个评论
Walter Roberson
Walter Roberson 2020-7-15
data = cat(1, image_patches,labels);
That code is overwriting all of data each iteration.
It looks to me as if data will not be a vector, but I do not seem to be able to locate any hellopatches() function so I cannot tell what shape it will be. As you are not doing imresize() I also cannot be sure that all of the images are the same size, so I cannot be sure that data will be the same size for each iteration. Under the circumstances you should be considering saving into a cell array.
Note: please do not post the same query multiple times. I found at least 3 copies of your query :(

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Mathematics 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by