MATLAB: Hello every body, i want to ask you how to derive an equation per a matrix ( 3X3)

derivativequationmatrix

the matrix X is:
X=[X11 X12 X13 ; X21 X22 X23; X31 X32 X33]
,the equation P is:
P=a.X11 +b.X12+c.X13+d.X21+e.X22+f.X22+g.X23+ h.X31+i.X32+j.X33

Best Answer

A = sym('X%d%d', [3 3]) ;
K = rand(3,3) ; % your constants
B = K.*A ;
iwant = sum(B(:))
Related Question