How to make a matrix of matrices in Matlab? (to be used to solve a system of linear equations)

2 views (last 30 days)
Hi,
I need to make a matrix of matrices in Matlab to later be used when solving a system of linear equations.
I know one solution is to create a mxn cell, and fill each cell with a matrix or vector, but you can't use cells with linsolve(), so this won't help me.
How can I have a matrix of matrices in Matlab?
Thanks!
clarification:
I have one cell structure
A = [25x25 double] [25x1 double] [25x1 double]
[ 1x25 double] [ 0] [ 0]
[ 1x25 double] [ 0] [ 0]
and another
b = [ 0]
[25x1 double]
[ 1]
And I want to do linsolve(A, b). Is this possible?

Answers (1)

José-Luis
José-Luis on 22 Aug 2012
Yes, you can, you need to use the curly braces:
test = cell(2,1);
test(1) = {rand(10)};
test(2) = {rand(10,1)};
linsolve(test{1},test{2});
  3 Comments
Pocho
Pocho on 22 Aug 2012
Ok, I should have clarified.
I'm have one cell structure
A = [25x25 double] [25x1 double] [25x1 double]
[ 1x25 double] [ 0] [ 0]
[ 1x25 double] [ 0] [ 0]
and another
b = [ 0]
[25x1 double]
[ 1]
And I want to do linsolve(A, b). Is this possible?

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!