Let's say we have the following sparse matrix defined by this 3 vectors:
[lines, columns, values] = find(A)
lines =
1
2
3
5
1
3
3
5
4
5
columns =
1
2
2
2
3
3
4
4
5
5
values =
3
4
7
3
1
5
9
6
2
5
What I am trying to achieve is to access the element at the position (2, 2)
I know you can do values(lines == 2)
(values(columns == 2)
) which will return all the values from second row (column).
My question is how can you do something like values(lines == 2 && columns == 2)
to get the value at A(2,2)
?