Calculate the entropy of a special value in one column

I exactly wanted to know that how I can caculate the entropy of different values in a column
For example assume I have two columns
1.Water pipe type (CICL,DICL) and
2.the class type (y=0:fail,Y=1 non-fail)
I want to know how I can caculate the entropy of for example CICL pipelines based on their class type.
Actually the main set would be for example CICL data by y=0 and y=1 something like R={CICL1 ,CICL2}
How can I calculate the entropy of each of value of a column regards to the value of another column
Regards

Answers (1)

hi, try :
R=randn(100,2); % two columns
e1=entropy(R(:,1)); % CICL
e2=entropy(R(:,2)); % DICL

2 Comments

Thanks for your answer
But CICL and DICL are two value of one column not two different columns and each of these values are belong to a class which is identified in another column.I want to calculate the entropy of each one related to their class
for example if we have 20 CICL.4 of them belong to class 1 and 16 of them belong to class 2.sort of changing the CICL as a new column with valuse of 1 and 2
hi, ok try to delimit the vector:
e1= entropy(CICL(1:4));
e2=entropy(CICL(5:end));
fine?

Sign in to comment.

Tags

Asked:

on 11 Apr 2013

Community Treasure Hunt

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

Start Hunting!