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.
I do not know if this what you want or not
ClearAll[f,i,j]
f[i_,j_]/;i<j:=5
f[i_,j_]/;j<i:=-5
f[i_,j_]:=0
(T0=Table[f[i,j],{i,1,10},{j,1,10}])//MatrixForm
Add per comment below
But different constants multiplied to f parameters in F should make
sure that elements of matrix are multiple of 5 & -5, not 5 and -5.
To multiply each entry by A
constant, you need to provide the corresponding
A
constants to use. Here is an example, using random generated constants.
ClearAll[f,i,j]
f[i_,j_]/;i<j:=5 * A0[[i,j]]
f[i_,j_]/;j<i:=-5*A0[[i,j]]
f[i_,j_]:=0
A0=RandomInteger[10,{10,10}];
(T0=Table[f[i,j],{i,1,10},{j,1,10}])//MatrixForm
Update Ref comment
Here is a much easier example and expected o/p for F= 5*f(1, 3)+6*f(2,
3)+4*f(1, 2) T = Table[F, {i, 1, 3}, {j, 1, 3}]; Should give T = {{
5*0+6*0+4*0, 5*0+6*0+4*5, 5*5+6*0+4*0}, { 5*0+6*0+4*(-5), 5*0+6*0+4*0,
5*0+6*5+4*0}, { 5*(-5)+6*0+4*0, 5*0+6*(-5)+4*0, 5*0+6*0+4*0}} on
simplification – T = {{0, 20, 25}, {-20, 0, 30}. {-25, -30 0}}
Ok, may be this is what you want now? You need a way to specify the constants and the entries they affect. I am still not sure if this is what you want
ClearAll[i,j]
(*this A0 encodes the input: 5*f(1, 3)+6*f(2,3)+4*f(1, 2) *)
A0={{5,{1,3}},{6,{2,3}},{4,{1,2}}};
T0=Table[0,{i,1,3},{j,1,3}];
makeEntry[{A0_,{i_,j_}}]:=
(T0[[i,j]]=If[i<j,5*A0,If[i>j,-5*A0,0]];T0[[j,i]]=-T0[[i,j]]);
makeEntry[#]&/@A0;
MatrixForm[T0]
m
andn
come from in the code you show? And what isf(f(m, n))
$\endgroup$n
andm
in the code? You showi
andj
only. Aren
andm
separate input? $\endgroup$m=1
andn=2
? If so, please edit your question and clarify thatn
andm
are extra input. $\endgroup$