cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Need help with creating a function.

lvl107
20-Turquoise

Need help with creating a function.

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

ACCEPTED SOLUTION

Accepted Solutions
StuartBruff
23-Emerald III
(To:lvl107)

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

View solution in original post

3 REPLIES 3
StuartBruff
23-Emerald III
(To:lvl107)

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

lvl107
20-Turquoise
(To:StuartBruff)

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

     Regards. Loi.

StuartBruff
23-Emerald III
(To:lvl107)

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

Stuart

Announcements

Top Tags