Skip to main content
20-Turquoise
September 13, 2015
Solved

Need help with creating a function.

  • September 13, 2015
  • 1 reply
  • 1355 views

Hello, Everyone.

Create a function .PNG

Need help with creating a function L_(X,Y) with output as the above. (green highlight)

Thanks in advance for your time and help.

      Regards. Loi.

Message was edited by: Loi Le

Best answer by StuartBruff

Loi Le wrote:

Hello, Everyone.

Need help with creating a function L_(X,Y) with output as the above. (green highlight)

Hi Loi,

The problem with your function L_ is that it modifies Yj when k=1, so the new value gets propagated into the k=2 iteration.  There are a couple of ways round it: assign Yj to a new variable at the start of each i,j loop or use your existing function L as a local function.

Stuart

1 reply

23-Emerald V
September 14, 2015

Loi Le wrote:

Hello, Everyone.

Need help with creating a function L_(X,Y) with output as the above. (green highlight)

Hi Loi,

The problem with your function L_ is that it modifies Yj when k=1, so the new value gets propagated into the k=2 iteration.  There are a couple of ways round it: assign Yj to a new variable at the start of each i,j loop or use your existing function L as a local function.

Stuart

lvl10720-TurquoiseAuthor
20-Turquoise
September 14, 2015

  I got it. . Many, many thanks for time and help, Stuart.

     Regards. Loi.

23-Emerald V
September 14, 2015

No worries, Loi.  I like to keep an eye on your posts and look at the interesting results you get.

Stuart