My teacher gave me a mfile for my final project. I read the code and i saw histc command. I have read about histc in Matlab help but i still dont understand what is it for.

 採用された回答

Walter Roberson
Walter Roberson 2018 年 1 月 19 日

1 投票

histc counts the number of items that fall into bins whose edges you specify.
histc (or equivalent) are the fundamental routines behind creating histograms -- histograms require counting the number of items that fall into each bin and then using a bar plot on the result.
There are other uses for histc as well, such as counting the number of occurrences of items. For example if you had a vector of values representing apples, oranges, and grapefruits, then you could use histc to count how many apples, how many oranges, how many grapefruits.
As well as just counting, histc() can tell you the number of the bin that each item falls into, which can be useful in many different situations.

1 件のコメント

Okinawa Rikenata
Okinawa Rikenata 2018 年 1 月 19 日
Thank you so much!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeData Distribution Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by