matlab help...distance/length
How do I find the distance between the two ones in this case?
M =
0
0
0
0
1
0
0
0
-1
0
0
0
1
0
0
0
-1
0
0
0
in this case the distance would be 8 but the number of zeros between will change...there will always be two 1's and two -1's..
M =
0
0
0
0
1
0
0
0
-1
0
0
0
1
0
0
0
-1
0
0
0
in this case the distance would be 8 but the number of zeros between will change...there will always be two 1's and two -1's..
0
Comments
edit:
You should be able to write a for loop that calculates the difference, unless you really have no idea how to use matlab.