Maniputalting data to input in a function.

1 次查看(过去 30 天)
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?

采纳的回答

Jan
Jan 2012-7-23
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Text Analytics Toolbox 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by