Could anyone help me understand why Julia is upset with
h[i,j] = h0 * (log10BM[i]^ηpred) * (log10BM[j]^ηprey) ?
I think it is unhappy with the
^ but I don’t understand why. Also, is there some manual or guideline on understanding error messages? I think Julia would be more beginner-friendly if something like this existed.
function create_h(NumTotalSpecies, log10BM, h0, ηpred, ηprey) h = zeros(NumTotalSpecies, NumTotalSpecies) for i = 1:NumTotalSpecies for j = 1:NumTotalSpecies h[i,j] = h0 * (log10BM[i]^ηpred) * (log10BM[j]^ηprey) end end return(h) end h = create_h(NumTotalSpecies, log10BM, h0, ηpred, ηprey) NumPlantSpecies = 8 NumAnimalSpecies = 12 NumTotalSpecies = NumPlantSpecies + NumAnimalSpecies log10BM_P = sort(rand(Uniform(10^0, 10^6), NumPlantSpecies)) log10BM_A = sort(rand(Uniform(10^2, 10^12), NumAnimalSpecies)) log10BM = vcat(log10BM_P,log10BM_A) ηpred = Normal(-0.48,0.03) ηprey = Normal(-0.66,0.02) h0 = 0.4