J
J
jack3d2015-05-19 16:34:04
Mathematics
jack3d, 2015-05-19 16:34:04

How to find the index of an element through a string?

There is such a matrix. When you click on an element with an index, you need to get its value.
0KAgJn7sxjDj2l.jpg
For example, when you click on 1 index in 1 row, you should get a total of 4.
Row + 1 = 4.
Tell me what the formula should be.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman, 2015-05-19
@jack3d

Something like
where m is the number of columns in the matrix

A
Alexander Movchan, 2015-05-19
@Alexander1705

You yourself can easily solve this problem if you formulate the question correctly.
Element or index?
For what unit? You have five of them. Perhaps if you put commas in this sentence, it will become a little clearer.

Row + 1 = 4.
Tell me what the formula should be.

Isn't that a formula?
PS sum = i*N + j, where i is the row number, j is the column number, N is the number of columns.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question