Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Matrix sum
Replies: 2   Last Post: Mar 5, 2013 4:36 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Milos Milenkovic

Posts: 154
Registered: 4/4/09
Matrix sum
Posted: Feb 27, 2013 2:42 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Dear,
how to generate matrix A[4,4] which is defined as the B0(j,b)*Ke1(a,b)*B1(i,a)+B0(j,b)*Ke1(a,b)*Delta1(i,a)+Delta0(j,b)*Ke1(a,b)*B1(i,a):
Delta1=sym('Delta1%d%d', [4,4]);
Delta0=sym('Delta0%d%d', [4,4]);
Inputs are:
K1=[-0.2582 -18.596 0 -0.2582; -34.737 -1300.188 0 -34.737; 0 0 0 0; -0.2582 -18.596 0 -0.2582];
K0=[2.337 48.551 0 2.337; 48.551 3072.487 0 48.551; 0 0 0 0; 2.337 48.551 0 2.337];
B1=[0.01 0.02 0.07 0.03; 0.02 0.05 0.06 0.02; 0.07 0.09 0.01 0.03; 0.01 0.03 0.02 0.04];
B0=[-1 0 0 0; 0 -1 0 0 ; 0 0 -1 0; 0 0 0 -1];
Ke1=[-785 -29351 2 -785; 758 28831 5 758; 72 2623 6 72; -382 -14175 2 -382];

Trial is:

for i=1:4
for j=1:4
A=0;
A=zeros(i,j);
for b=1:4
for a=1:4
A=A+B0(j,b)*Ke1(a,b)*B1(i,a)+B0(j,b)*Ke1(a,b)*Delta1(i,a)+Delta0(j,b)*Ke1(a,b)*B1(i,a)
end
end
end
end
end

the output for cell 1,1 of matrix A is:
(89*Delta011)/100 + (4147*Delta012)/100 + (3*Delta013)/5 + (89*Delta014)/100 + 785*Delta111 - 758*Delta112 - 72*Delta113 + 382*Delta114 - 89/100



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.