The code you have posted is not complete, as you have not defined dx
and it is unclear what dx(i)
is supposed to represent.
Please see:Read before posting: How do I get my question answered? - #4 by nate for examples following the forum guidelines