i have the following:
v=[1 2 ; 3 4]
v =
1 2
3 4
as a 4 by 4 matrix is beeing read in thefollowing manner
2 4 (1,2) (2,2)
1 3 (1,1) (2,1)
So
1 is (1,1)
2 is (1,2)
3 is (2,1)
4 is (2,2)
Now if I want to call it as single index I am having a problem since:
v(1) is 1
but v(2) is 3 it is reading as:
3 4
1 2
if i call it as 2 index i will have several loops which wont be easy, but if i use single index the referencing is switched i am getting wrong answers.
how to solve this?
thanks hope i am clear
If I understand your question, you can simply transpose your matrix and use a single index. For more complicated indexing issues you may find
shiftdimto be useful.