lingo !subscript out of range on attribute:y. 求助!急求!

蛋白质猪2022-10-04 11:39:541条回答

lingo !subscript out of range on attribute:y. 求助!急求!
model:
!问题;
min=(@sum(x))^2-(@sum(ver))^2;
sets:
province/pr1..pr3/:pro;
vertical/ve1..ve5/:ver;
links(province,vertical):x,y;
endsets
data:
pro=15 9 5;
ver=9 8 10 1 1;
y=0.5 0.5 0.5 0.5 0.5 0.3 0.3 0.3 0.3 0.3 0.2 0.2 0.2 0.2 0.2;
enddata
@for(vertical(i)|i#le#5:
x(i,j)ver(i)*y(i,j)-1);
@for(vertical(i)|i#le#5:
@sum(province(j)|j#le#3:x(i,j))=ver(i));
@for(province(j)|j#le#3:
@sum(vertical(i)|i#le#5:x(i,j))=pro(j));
@for(vertical(i)|i#le#5:@gin(x));
end

已提交,审核后显示!提交回复

共1条回复
ndggspn 共回答了23个问题 | 采纳率82.6%
首先第一句语法就不对 @sum应该是@sum(集名:表达式) 你这个写的完全不对 另外你不要在集定义前面就写集循环函数
后面你@for只对i循环了 那j是多少?是某个确定的数还是要对j循环?你都没有写
1年前

相关推荐

what is a subscript in a chemical formula?what's the relatio
what is a subscript in a chemical formula?what's the relationship between element and stom?
我科学作业做不出~~~Science!
还有几个问题:
How to tell a substance is a compound or not a compound?
How does the density make things sink of float in a liquid?
chemical formula:carbon dioxide ozone backing soda
答对一定加分!
LISAnekol1年前1
艾艾呓语 共回答了16个问题 | 采纳率75%
a subscript of a chemical formula is the number of atoms of the element.
chemical element is the generic terms of a kind of atom that with the same inuclear charge.
and atom is the smallest particles in chemical change.
chemical element is the general term for the same type of atoms; and atoms constitute the basic unit of element.
if a substance with different atoms in it.it is a compound.
if the density of the object is larger than the liquid's.it will sink.
the last question i can't understand whats your meaning.
“subscript out of
16051年前1
irene306 共回答了21个问题 | 采纳率81%
1.数组索引超出范围
subscript list 下标列表
subscript out of range 数组索引超出范围
2.数组定义超出边界
Floating point exception 浮点数异常错误
Subscript out of range 数组定义超出边界
3.下标范围不够
Subscript indices must either be real positive integers or l
Subscript indices must either be real positive integers or logicals.
爱ff菜的喽罗1年前1
诡才 共回答了19个问题 | 采纳率89.5%
x=x(i)-xc%j改成i这个错误是说:角标不能是正整数或逻辑变量 由于你的循环变量是i而你下面的循环又用j rx=x(j)-xc这句应当是rx=x(i)-xc %j改成i
matlab Subscript indices must either be real positive intege
matlab Subscript indices must either be real positive integers or logicals错误
a=[1,2,3,4,5,6,7,8,9,10];
for i=1:length(a)/2
b(i)=a(2i);
end
以上举个例子,实际向量要长得多,就是把原向量a每隔一个数取一个数再组成一个长度为原来二分之一的向量b,为何会出现Subscript indices must either be real positive integers or logicals.的错误?
几木长口1年前1
可爱萱 共回答了12个问题 | 采纳率100%
a=[1,2,3,4,5,6,7,8,9,10];
for i=1:length(a)/2
b(i)=a(2*i);
end
改成上面的,b(i)=a(2*i);这句中乘法要加运算符的

大家在问