Gauss-Jordan linearization by blocks using symbolic variable

2 views (last 30 days)
Supouse there is a linear system with the form: Ax=B. A partition by segments in the vector "x" is performed so the resulting system has the form:
[A11, A12, ... ,A1n][x1]=[B1]
[A21, A22, ... ,A2n][x2]=[B2]
. .
. .
. .
[An1, An2, ... ,Ann][xn]=[Bn]
So... Does anyone knows an strategy for solving symbolically the Gauss-Jordan elimitation of this equation...
Some code lines like:
As=sym('A',[num,num]); Bs=sym('B',[num,1]);
As_gauss=[As,Bs];
for k=1:num
As_gauss(k,:)=As_gauss(k,k)\As_gauss(k,:);
for j=k+1:num
As_gauss(j,:)=As_gauss(j,:)-As_gauss(j,k)*As_gauss(k,:);
end
end
for k=num:-1:2
for j=k-1:-1:1
As_gauss(j,:)=As_gauss(j,:)-As_gauss(k,:)*As_gauss(j,k);
end
end
Are helpfull when the cluster of the variable x is no longer than length 1... otherwise the matrix algebra rules are not taken into acount since the elements of A and B are scalars for matlab...
I guess my real question is: Is it possible to build symbolical matrixes in which each element is also a matrix of some determinated dimension but with solutions in function of the submatrixes instead of its smallest elements ???
eventhoug my problem intrigues me.. I've reach the point where I need anotherone's opinion... If some of you think about a better framework to attack my problem I would be grateful... thank you. Saludos!

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!