matlab常用函数

ind2sub函数可以用来把矩阵元素的index转换成对应的下标（determines the equivalent subscript values corresponding to a single index into an array）

[I,J] = ind2sub(siz,IND) returns the matrices I and J containing the equivalent row and column subscripts corresponding to each linear index in the matrixIND for a matrix of size sizsiz is a vector with ndim(A) elements (in this case, 2), wheresiz(1) is the number of rows andsiz(2) is the number of columns.

```在命令窗口输入：
>> A=[4 7 2 9 8;3 9 1 4 3;1 5 9 6 4;8 3 7 1 0]
A =
4     7     2     9     8
3     9     1     4     3
1     5     9     6     4
8     3     7     1     0

1     5     9    13    17
2     6    10    14    18
3     7    11    15    19
4     8    12    16    20
ind=sub2ind(siz,I,J):siz表示要转换的矩阵的行列数，I是要转换矩阵的行标，J是要转换矩阵的列标。I,J的行列数必须相同。ind为输出参数，其行列数与I,J相同。ind即为索引。

>> ind=sub2ind(size(A),[1,2;3,4],[1,1;2,2])

ind =
1     2
7     8

TomTom

BlueAsteroid

Just another WordPress.com site

Jing's Blog

Just another WordPress.com site

Start from here......

Just another WordPress.com site

Where On Earth Is Waldo?

A Project By Melanie Coles

the Serious Computer Vision Blog

A blog about computer vision and serious stuff

Cauthy's Blog

paper review...

Cornell Computer Vision Seminar Blog

Blog for CS 7670 - Special Topics in Computer Vision

datarazzi

Life through nerd-colored glasses

Luciana Haill

Brainwaves Augmenting Consciousness

1,2,∞

Dr Paul Tennent

and the university of nottingham

turn off the lights, please

A bunch of random, thinned and stateless thoughts around the Web