Create Matrix By Several Matrices These Matrices Have Elements By Equations
1 次查看(过去 30 天)
显示 更早的评论
Create Matrix By Several Matrices These Matrices Have Elements By Equations:
Matrix A = zeros (1728,432), Included Matrices (12,3) puted as Diagonal every element an Equation.
A = [Ax1 Bx1 Cx1 0 0 0 ...; Ay1 By1 Cy1 0 0 0 ....; Ax2 Bx2 Cx2 0 0 0 ...; Ay2 By2 Cy2 0 0 0 ...; ........;Ax12 Bx12 Cx12 0 0 0...; Ay12 By12 Cy12 0 0 0 ...; 0 0 0 Ax1 Bx1 Cx1 0 0 0 ...; 0 0 0 Ay1 By1 Cy1 0 0 0 ... ].
In another word Matrix A = [ Matrix (12*3) Zeros zeros zeros
zeros Matrix (12*3) zeros zeros
zeros zeros Matrix (12*3) zeros ..
... ... ... ... ]
Ax1, Bx1, ..... every element equal equation thier values differes as 288 inputs.
If some one can arrange the loops of matrices and the Main matrix A.
Thanks for any Help
Thanks for any thought
Bashar
5 个评论
回答(1 个)
Stephen23
2020-5-20
编辑:Stephen23
2020-5-20
Having lots of numbered variables is not a good approach, you should place all of those sub-matrices into one cell array when they are created (this is trivial using indexing), i.e.:
C = {M1,M2,... };
where
M1 = [Ax1,Bx1,Cx1;Ay1,By1,Cy1,...];
etc. Of course you should just use indexing when you create them, and NOT use numbered variable names,
B = blkdiag(C{:});
If there is actually just one submatrix repeated (as your question shows), then you can do this:
C = {M};
B = blkdiag(C{ones(1,144)});
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Camera Calibration 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!