Maniputalting data to input in a function.

1 visualización (últimos 30 días)
Abhivyakti
Abhivyakti el 23 de Jul. de 2012
I have a function for entropy. I need to test data in the form of table (19 rows and 1359 columns). I need to know in what form is the input in the following function supposed to be. And how do i manipulate my input data(in the form of a table) to use in this function.
The following is the function :
function [e]=fpermentr(vstup)
y=vstup;
sd = std(y);
y = (y-mean(y))/sd;
ly = length(y);
ord = 4;
permlist = perms(1:ord);
c(1:length(permlist))=0;
for j=1:ly-ord
[a,iv]=sort(y(j:j+ord-1));
for jj=1:length(permlist)
if (abs(permlist(jj,:)-iv))==0
c(jj) = c(jj) + 1 ;
end
end
end
p = max(1/ly,c/(ly-ord));
e = -sum(p .* log(p))/(ord-1);
end
[EDITED] Also in which form will i get the output?

Respuesta aceptada

Jan
Jan el 23 de Jul. de 2012
If you get a function, which does not define the input and output in the help text and which does not contain any comments, this function is not usable. A reliable method to handle this is either asking the author for a well documented code, or to delete the file.
Using a function based on guessing its features is a bad idea. It is like driving a car, at night, with switched off light, and sunglasses, and backwards, but looking to front.
Sorry for the lack of help in this answer. I want to support your reliable programming techniques.

Más respuestas (0)

Categorías

Más información sobre Text Analytics Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by