Maniputalting data to input in a function.

조회 수: 1 (최근 30일)
Abhivyakti
Abhivyakti 2012년 7월 23일
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