필터 지우기
필터 지우기

How to proceed in this case?

조회 수: 2 (최근 30일)
hrushikesh kyathari
hrushikesh kyathari 2019년 7월 13일
댓글: dpb 2019년 7월 13일
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
dpb
dpb 2019년 7월 13일
"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.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by