hist command equivalent in java

Hi i am new to matlab, i need a help. I got a matlab code which uses hist command, i am porting the code to java, is there any equivalent code in java or can anyone give the logic behind hist command i can write it in java or c. Thanks in advance.

5 comentarios

Walter Roberson
Walter Roberson el 30 de Jun. de 2013
histc() is a bit easier to program; would that be suitable for your purpose? The major semantic difference is that the bin locations must be specified for histc() whereas hist() can figure out where to put the bin locations according to the data and the number of bin.
histc() wants bin edges, where hist() works with bin centers, but once the bin locations are known, converting between edges and centers is easy.
Ramasamy Seenivasagan
Ramasamy Seenivasagan el 1 de Jul. de 2013
Thanks Walter Roberson, as you said histc() works for me, is there any code or logic available. It will be very useful. Thanks once again.
Image Analyst
Image Analyst el 1 de Jul. de 2013
Editada: Image Analyst el 1 de Jul. de 2013
This is very easy to write in 2 or 3 minutes. If you still need help writing this simple algorithm in C or Java as you require, I'm sure you can find forums for that. We don't provide assistance writing C or Java code.
Walter Roberson
Walter Roberson el 1 de Jul. de 2013
Do your bins happen to be equally spaced? And if they are, then is acceptable if samples within round-off error of the bin edges might be misclassified ?
Ramasamy Seenivasagan
Ramasamy Seenivasagan el 3 de Jul. de 2013
Thanks image Analyst and Walter Robertson, i wrote java code and it works perfect. Thanks for your advice.

Iniciar sesión para comentar.

Respuestas (1)

Image Analyst
Image Analyst el 30 de Jun. de 2013

0 votos

To construct the histogram an important step is to decide where to put the edges of the bins. To see the code do this:
>> edit hist.m
You can see edges mentioned in several places. Then translate the code into Java or C, whichever you decide on.

Categorías

Más información sobre Introduction to Installation and Licensing en Centro de ayuda y File Exchange.

Preguntada:

el 30 de Jun. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by