Skip to main content
added 189 characters in body
Source Link
user49535
  • 1.2k
  • 6
  • 11

I have a function which can be represented as described below, (herea weighted sum of parameters f(m, n) represents different variables). Where m & n have values 1 - 10.

 fF = A1* f(1, 2) + A2* f(2, 3) + A3* f(3, 1) + .... = f(f(m, n))

I want to use this f function toF to form a 2D table such that

FT = Table[fTable[F, {i, 1, 10}, {j, 1, 10}]

with conditions such that when for a(i, j)th element of table

If i = m && j = n -> f(m, n) = 5, 
If i = n && j = m -> f(m, n) = -5
otherwise f(m, n) = 0

To elaborate, for the {2, 3}th element of this table, f(2, 3) should be replaced by 5, f(3, 2) by -5 and other f terms by 0.

How can I do it. Could If function be used with table ?? I could not make it work. Will appreciate any suggestion.. Thanks

I have a function as described below, (here f(m, n) represents different variables)

 f = f(1, 2) + f(2, 3) + f(3, 1) + .... = f(f(m, n))

I want to use this f function to form a 2D table such that

F = Table[f, {i, 1, 10}, {j, 1, 10}]

with conditions such that when for a element of table

If i = m && j = n -> f(m, n) = 5, 
If i = n && j = m -> f(m, n) = -5
otherwise f(m, n) = 0

How can I do it. Could If function be used with table ?? I could not make it work. Will appreciate any suggestion.. Thanks

I have a function which can be represented as a weighted sum of parameters f(m, n). Where m & n have values 1 - 10.

F = A1* f(1, 2) + A2* f(2, 3) + A3* f(3, 1) + .... 

I want to use this F to form a 2D table such that

T = Table[F, {i, 1, 10}, {j, 1, 10}]

with conditions such that for (i, j)th element of table

If i = m && j = n -> f(m, n) = 5, 
If i = n && j = m -> f(m, n) = -5
otherwise f(m, n) = 0

To elaborate, for the {2, 3}th element of this table, f(2, 3) should be replaced by 5, f(3, 2) by -5 and other f terms by 0.

How can I do it. Could If function be used with table ?? I could not make it work. Will appreciate any suggestion.. Thanks

Source Link
user49535
  • 1.2k
  • 6
  • 11

Forming a 2D table with conditions with a function

I have a function as described below, (here f(m, n) represents different variables)

 f = f(1, 2) + f(2, 3) + f(3, 1) + .... = f(f(m, n))

I want to use this f function to form a 2D table such that

F = Table[f, {i, 1, 10}, {j, 1, 10}]

with conditions such that when for a element of table

If i = m && j = n -> f(m, n) = 5, 
If i = n && j = m -> f(m, n) = -5
otherwise f(m, n) = 0

How can I do it. Could If function be used with table ?? I could not make it work. Will appreciate any suggestion.. Thanks