Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

ind2sub (MathScript Function) (Windows, Not in Base Package)

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

Member of the support class.

Syntax

[c, d] = ind2sub(size, a)

Description

Converts the linear indexes of matrix elements to their row-column positions.

Examples

Inputs

Name Description
size Specifies the size of a matrix. size is a two-element vector of integers.
a Specifies the linear positions of elements in a matrix of the size you specify. a is a matrix of integers.

Outputs

Name Description
c Returns the row numbers of the elements with linear positions a. c is a matrix of integers of the same size as a.
d Returns the column numbers of the elements with linear positions a. d is a matrix of integers of the same size as a.

Examples

A = [1, 2, 3; 4, 5, 6]
SIZE = size(A)
[C, D] = ind2sub(SIZE, A)

Related Topics

sub2ind


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit