【发布时间】:2015-04-24 11:12:32
【问题描述】:
我尝试搜索,但似乎没有找到任何解决我的问题的方法。它说
试图访问 L(1);索引超出范围,因为 数字(L)=0。
Energy_Management_code 错误(第 64 行) a(k)=L(1);
这是出错的代码
%Arranging the data according to its location
L=NUMERIC(:,Location_no_column);
k=1;
a(k)=L(1);
p(1).loc=find(L/a(k)==1);
L(p(1).loc)=nan;
while max(isfinite(L))==1
next=min(FIND(isfinite(L)));
a(length(a)+1)=L(next);
p(length(a)).loc=find(L/a(length(a))==1);
L(p(length(a)).loc)=nan;
end
for i=1:length(a)
Location(i).ID=a(i);
Location(i).Place=p(i).loc;
Location(i).Number=length(Location(i).Place);
end
【问题讨论】:
-
你能提供一个minimal, reproducible example吗?
标签: matlab