Skip to main content
added 101 characters in body
Source Link
bill s
  • 70.1k
  • 4
  • 105
  • 200

Another thing to look at is the difference between = and :=. For example, if you define your first function as

f[a_, t_, c_] := Sum[c[[i]] Exp[-(a - t[[i]])^2], {i, 1, 3}] 

then you get no warnings and you can evaluate

f[a, {t1, t2, t3}, {c1, c2, c3}] 

as you wish. You can also take derivatives

D[f[a, {t1, t2, t3}, {c1, c2, c3}], a] 

without any problem.

Another thing to look at is the difference between = and :=. For example, if you define your first function as

f[a_, t_, c_] := Sum[c[[i]] Exp[-(a - t[[i]])^2], {i, 1, 3}] 

then you get no warnings and you can evaluate

f[a, {t1, t2, t3}, {c1, c2, c3}] 

as you wish.

Another thing to look at is the difference between = and :=. For example, if you define your first function as

f[a_, t_, c_] := Sum[c[[i]] Exp[-(a - t[[i]])^2], {i, 1, 3}] 

then you get no warnings and you can evaluate

f[a, {t1, t2, t3}, {c1, c2, c3}] 

as you wish. You can also take derivatives

D[f[a, {t1, t2, t3}, {c1, c2, c3}], a] 

without any problem.

Source Link
bill s
  • 70.1k
  • 4
  • 105
  • 200

Another thing to look at is the difference between = and :=. For example, if you define your first function as

f[a_, t_, c_] := Sum[c[[i]] Exp[-(a - t[[i]])^2], {i, 1, 3}] 

then you get no warnings and you can evaluate

f[a, {t1, t2, t3}, {c1, c2, c3}] 

as you wish.