Thank you @henrique_becker for getting back to me. It did solve the error. How ever, I do have one other error after making the suggested change. Here the indices of variables are separated by comma but I still get a method matching error. Could you please help me with this one as well.
MethodError: no method matching -(::VariableRef, ::Array{Int64,1})
for t in 1:tp
for i in 1:NJ[t]
c2= @constraint(p, B[t,i,1] - nums[t,i] <= 0)
set_name(c2, "InitConstraint_[$i],[$t]")
end
end
nums[t,i] is a 2D array.
tp = 3
NJ = [7,5,8]
nums = [[13,2,21,16,11,2,5], [29,30,26,28,8], [8,5,16,130,5,13,30,4]]
Also, sorry about the previous format of the code.
Thank you in advance!!