Borrar filtros
Borrar filtros

How to proceed in this case?

2 visualizaciones (últimos 30 días)
hrushikesh kyathari
hrushikesh kyathari el 13 de Jul. de 2019
Comentada: dpb el 13 de Jul. de 2019
I have a set of matrices F1,F2,....,F16; each of them is 3*1 matrices.
All these matrices should be stored as
F := [F1,....,F8, 0, ...... ,0;
0,....,F8,F9, ...... ,F16;
0,..,F5,... F12,0,...,0]
and F will be used as k=Z\F;
But I get the error:Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 5-by-1.
I guess we need take use a cell in this case but how to define and also if I use a cell, the calculation Z\F must be done.
The dimensions of Z are good for calculations
  1 comentario
dpb
dpb el 13 de Jul. de 2019
"I have a set of matrices F1,F2,....,F16; ..."
Which is the problem -- do not create multiple variables with sequential names, create these as cell array in the beginning.
Then you can deal with them programmatically via cell2mat() or address each as needed.
Probably given the need to build the 2D array a 2D array would be better than just 1...N
You'll have to build the zeros() arrays as well or use sparse() array addressing modes.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Productos


Versión

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by