ind2sub: ind2sub

ind2subR Documentation

ind2sub

Description

MATLAB style ind2sub function in R physical essence. Provides the 2D row / column index for a given 1D query

Usage

ind2sub(dim, ind, byrow = F)

Arguments

dim

dimensions of matrix to query

ind

1D index

byrow

whether to calculate indices by row or column (= FALSE)

Value

length(ind) x 2 matrix of row and column index pairs corresponding to input ind in dim "dim" matrix

Author(s)

Marcin Imielinski


mskilab/skitools documentation built on Aug. 31, 2023, 1:13 p.m.