Filter löschen
Filter löschen

How to proceed in this case?

2 Ansichten (letzte 30 Tage)
hrushikesh kyathari
hrushikesh kyathari am 13 Jul. 2019
Kommentiert: dpb am 13 Jul. 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 Kommentar
dpb
dpb am 13 Jul. 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.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Produkte


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by