No BSD License  

Highlights from
Coordinate-Element Number Conversion

1.0

1.0 | 2 ratings Rate this file 3 Downloads (last 30 days) File Size: 983 Bytes File ID: #7377

Coordinate-Element Number Conversion

by Aman Siddiqi

 

06 Apr 2005 (Updated 13 Apr 2005)

Converts row, column, dimension to element number & vice versa

| Watch this File

File Information
Description

coordinate2element_num: Converts row, column & dimension to the element number for the matrix. So row 2, column 3 of a 10X10 is 22.
element_num2coordinate: converts element number 22 of a 10X10 to [2,3]. I only wrote them for up to 3 dimensions. Some one could expand them if they want to.

MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
08 Apr 2005 urs (us) schwarz

did you look at sub2ind (and its sibling ind2sub)?

12 Jan 2006 Duane Hanselman

Duplicates MATLAB functions sub2ind and ind2sub.

15 Oct 2009 Jan Simon

As mentioned already some years ago: SUB2IND and IND2SUB handle this more powerful: Any number of dims and error checking. Replying a string if the matrix size is exceeded impedes debugging.

Please login to add a comment or rating.
Updates
12 Apr 2005

added element_num2coordinate

13 Apr 2005

small change

Tag Activity for this File
Tag Applied By Date/Time
structures Aman Siddiqi 22 Oct 2008 07:45:10
cell arrays Aman Siddiqi 22 Oct 2008 07:45:10
coordinate Aman Siddiqi 22 Oct 2008 07:45:10
element Aman Siddiqi 22 Oct 2008 07:45:10
number Aman Siddiqi 22 Oct 2008 07:45:10
row Aman Siddiqi 22 Oct 2008 07:45:10
column Aman Siddiqi 22 Oct 2008 07:45:10
dimension Aman Siddiqi 22 Oct 2008 07:45:10

Contact us at files@mathworks.com