28.12.2012 Views

Figure Properties - SERC

Figure Properties - SERC

Figure Properties - SERC

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

IND = [3 4 5 6]<br />

s = [3,3];<br />

[I,J] = ind2sub(s,IND)<br />

I =<br />

J =<br />

3 1 2 3<br />

1 2 2 2<br />

Example 2. The mapping from linear indexes to subscript equivalents for a<br />

2-by-2-by-2 array is<br />

1<br />

2<br />

This code determines the subscript equivalents in a 2-by-2-by-2 array, of<br />

elements whose linear indices 3, 4, 5, 6 are specified in the IND matrix.<br />

IND = [3 4;5 6];<br />

s = [2,2,2];<br />

[I,J,K] = ind2sub(s,IND)<br />

I =<br />

J =<br />

3<br />

4<br />

5<br />

6<br />

1 2<br />

1 2<br />

2 2<br />

1 1<br />

7<br />

8<br />

1,1,1<br />

2,1,1<br />

1,2,1<br />

2,2,1<br />

1,1,2<br />

2,1,2<br />

1,2,2<br />

2,2,2<br />

ind2sub<br />

2-1169

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!