| 查看: 995 | 回复: 1 | ||
[求助]
matlab中排列熵程序出错 已有1人参与
|
|
请教,程序如下,请大神帮帮忙, function [pe hist c] = pec(y,m,t) % Calculate the permutation entropy % Input: y: time series; % m: order of permuation entropy % t: delay time of permuation entropy, % Output: % pe: permuation entropy % hist: the histogram for the order distribution %Ref: G Ouyang, J Li, X Liu, X Li, Dynamic Characteristics of Absence EEG Recordings with Multiscale Permutation % % Entropy Analysis, Epilepsy Research, doi: 10.1016/j.eplepsyres.2012.11.003 % X Li, G Ouyang, D Richards, Predictability analysis of absence seizures with permutation entropy, Epilepsy % % Research, Vol. 77pp. 70-74, 2007 ly = length(y); permlist = perms(1:m); c(1:length(permlist))=0; for j=1:ly-t*(m-1) [a,iv]=sort(y(j:t:j+t*(m-1))); for jj=1:length(permlist) if (abs(permlist(jj, -iv))==0c(jj) = c(jj) + 1 ; end end end hist = c; c=hist(find(hist~=0)); p = c/sum(c); pe = -sum(p .* log(p)); % normalizedpe=pe/log(factorial(m)); 程序如上所示,请问我在运行时出现错误 >> pec(a,2,6) 错误使用 - 矩阵维度必须一致。 出错 pec (line 25) if (abs(permlist(jj, -iv))==0这是什么问题呢? |
» 猜你喜欢
遇见不省心的家人很难过
已经有23人回复
天津大学招2026.09的博士生,欢迎大家推荐交流(博导是本人)
已经有6人回复
AI 太可怕了,写基金时,提出想法,直接生成的文字比自己想得深远,还有科学性
已经有6人回复
有院领导为了换新车,用横向课题经费买了俩车
已经有9人回复
酰胺脱乙酰基
已经有13人回复
博士延得我,科研能力直往上蹿
已经有8人回复
同年申请2项不同项目,第1个项目里不写第2个项目的信息,可以吗
已经有4人回复
有时候真觉得大城市人没有县城人甚至个体户幸福
已经有10人回复
霜小妹二
木虫 (正式写手)
哈哈
- 应助: 154 (高中生)
- 金币: 1806.7
- 红花: 25
- 帖子: 531
- 在线: 66小时
- 虫号: 3237838
- 注册: 2014-05-27
- 专业: 机械动力学

2楼2016-03-28 21:03:03













-iv))==0
回复此楼