[英]Positions of matrices
i'm learning matrices. 我正在学习矩阵。 I found out how to get to plenty of positions in matrices, but there are still some i can't figure out and i got stuck with.
我找到了如何在矩阵中获得大量职位的方法,但是仍然有些我无法弄清楚,因此我陷入了困境。
For example if we got matrice with height n=5, where i and j go from 0, i = rows, j = columns. 例如,如果我们得到高度为n = 5的矩阵,其中i和j从0开始,i =行,j =列。 (i don't use any array, just for in for)
(我不使用任何数组,仅用于in)
Matrice: 矩阵:
00 01 02 03 04 00 01 02 03 04
10 11 12 13 14 10 11 12 13 14
20 21 22 23 24 20 21 22 23 24
30 31 32 33 34 30 31 32 33 34
40 41 42 43 44 40 41 42 43 44
When i want to get : 当我想得到时:
This is what i can't figure out 这是我不知道的
I don't want you to give me all the code i need i just want you to direct me to answer so i can figure it out by myself. 我不希望您给我我需要的所有代码,而只是希望您指示我回答,以便我自己解决。 This piece of code from parts i need must work for every height i want, not only for height 5.
我需要的这些代码段必须适合我想要的每个高度,而不仅仅是高度5。
And, if you could give me some good advice how to fix matrices problems, which methods did you use. 而且,如果您能给我一些很好的建议,以解决矩阵问题,请使用哪种方法。
你可以结合的条件-例如,(10,20,30,21)将低于主对角线和上面的次对角线: if(i > j && i+j < n-1)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.