Effacer les filtres
Effacer les filtres

How to count number of occurrence appear in a vector ?

2 vues (au cours des 30 derniers jours)
Siti Suhaila
Siti Suhaila le 8 Août 2017
Commenté : José-Luis le 8 Août 2017
Hello everyone, How to count the num of occurrence in a vector and display it followed with the column that represents the num? The first image (A) is 10x1 of a vector.The result should display the num of occurrence from the first image (A) with 1:500 on the second image. However, when i check column 33 the result shows '0' instead of '1'. Thank you in advanced.
The code that I used is as below:
h=histc(result{i,:}(:,:),(1:500));
  1 commentaire
José-Luis
José-Luis le 8 Août 2017
Well, in your results, 43 appears to have a count of one but does not appear in your input.
What you are feeding histc probably does not contain what you think it does.
You can try using the debugger and checking for yourself.

Connectez-vous pour commenter.

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by