Skip to main content
edited tags
Link
deleted 12 characters in body
Source Link
user49535
  • 1.2k
  • 6
  • 11

I have a function F, function of four other f functions, as shown below (1, 2, 3, 4 are indices here not numbers)

F = f{1}*f{2}*f{3}*f{4}f[1]*f[2]*f[3]*f[4]

I want to create a table using this function such that for each (i, j)th element f{i}f[i], f{j}f[j] and other f elements are replaced by functions X, Y and Z respectively. Replacing f{i}f[i] and f{j}f[j] is easy as follows, but I am not able to figure out how to represent "indices other than i and j" in this function.

G = Table[F/.{f{i}f[i] -> X, f{j}f[j] -> Y}, {i, 1, 4}, {j, 1, 4}]

Will appreciate any help. thanks

I have a function F, function of four other f functions, as shown below (1, 2, 3, 4 are indices here not numbers)

F = f{1}*f{2}*f{3}*f{4}

I want to create a table using this function such that for each (i, j)th element f{i}, f{j} and other f elements are replaced by functions X, Y and Z respectively. Replacing f{i} and f{j} is easy as follows, but I am not able to figure out how to represent "indices other than i and j" in this function.

G = Table[F/.{f{i} -> X, f{j} -> Y}, {i, 1, 4}, {j, 1, 4}]

Will appreciate any help. thanks

I have a function F, function of four other f functions, as shown below (1, 2, 3, 4 are indices here)

F = f[1]*f[2]*f[3]*f[4]

I want to create a table using this function such that for each (i, j)th element f[i], f[j] and other f elements are replaced by functions X, Y and Z respectively. Replacing f[i] and f[j] is easy as follows, but I am not able to figure out how to represent "indices other than i and j" in this function.

G = Table[F/.{f[i] -> X, f[j] -> Y}, {i, 1, 4}, {j, 1, 4}]

Will appreciate any help. thanks

Source Link
user49535
  • 1.2k
  • 6
  • 11

How to represent "For all elements other than i & j in a table"

I have a function F, function of four other f functions, as shown below (1, 2, 3, 4 are indices here not numbers)

F = f{1}*f{2}*f{3}*f{4}

I want to create a table using this function such that for each (i, j)th element f{i}, f{j} and other f elements are replaced by functions X, Y and Z respectively. Replacing f{i} and f{j} is easy as follows, but I am not able to figure out how to represent "indices other than i and j" in this function.

G = Table[F/.{f{i} -> X, f{j} -> Y}, {i, 1, 4}, {j, 1, 4}]

Will appreciate any help. thanks