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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Need help to create a function which is equivalent to an other function.

lvl107
20-Turquoise

Need help to create a function which is equivalent to an other function.

Hello All,

My question is :

Seeking+a+equivalent+function.PNG

Thanks in advance for your time and help.

Best Regards.

1 ACCEPTED SOLUTION

Accepted Solutions
Werner_E
24-Ruby V
(To:lvl107)

Find attached the modified progs for N1 and N2.

I still have no clue what the benefit of avoidubg sum and product should be!?

SumProduct2.png

View solution in original post

4 REPLIES 4
StuartBruff
23-Emerald II
(To:lvl107)

You've only defined the product loop - I can't see where you've defined the summation equivalent?

Werner_E
24-Ruby V
(To:lvl107)

In your definition of N1 the product runs from 0 to k-1 and is inside the summation with index k starting at 0. That way you would address vector element -1 which does not exist (assuming ORIGIN=0). This is to be avoided as summation and product react somewhat illogical in that situation.

Does N1 give you the desired result? Even then you should rewrite it.

You can easily rewrite your function N1 withou using sum and product using three nested for-loops for n, k and j, while I can see no reason why you should want to do so! The new function will produce different results because auf that failure above (you will get expressions with (a[-1.

Seeking1.png

Werner_E
24-Ruby V
(To:lvl107)

Find attached the modified progs for N1 and N2.

I still have no clue what the benefit of avoidubg sum and product should be!?

SumProduct2.png

lvl107
20-Turquoise
(To:Werner_E)

I greatly appreciate your time and help, Werner and Stuart. Your answers are very neat and complete to my question, Werner.

Seeking+a+equivalent+function_.PNG

Best Regards.

Top Tags