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

1 次查看(过去 30 天)
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?

回答(1 个)

José-Luis
José-Luis 2012-8-22
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 个评论
Pocho
Pocho 2012-8-22
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?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by