Effacer les filtres
Effacer les filtres

Get the value of property from bagOfWords

1 vue (au cours des 30 derniers jours)
Phil_911
Phil_911 le 15 Juil 2020
Commenté : Walter Roberson le 15 Juil 2020
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 commentaires
Phil_911
Phil_911 le 15 Juil 2020
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 le 15 Juil 2020
And I need to extract the value 68 of the bag of Words for further calculations.

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 15 Juil 2020
  2 commentaires
Phil_911
Phil_911 le 15 Juil 2020
Thanks!
Walter Roberson
Walter Roberson le 15 Juil 2020
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 :(

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by