Maniputalting data to input in a function.
显示 更早的评论
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?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Data Import and Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!