[Index for tmp_for_tar/mcompat] [Return to Master Index]

sub2ind

(tmp_for_tar/mcompat/sub2ind.m)


Function Synopsis

[r,c] = sub2ind(sz,ii)

Help text

       [r,c] = sub2ind(sz,i)

 r and c are the row and column of the i'th element of a matrix of
 size sz. That is, r = 1+rem(i,sz(1)), c = 1+floor(i/sz(1)).

 See also sub2ind.

 Last modified: January 2000



Listing of function file tmp_for_tar/mcompat/sub2ind.m

##       [r,c] = sub2ind(sz,i)
##
## r and c are the row and column of the i'th element of a matrix of
## size sz. That is, r = 1+rem(i,sz(1)), c = 1+floor(i/sz(1)).
##
## See also sub2ind.
##

## Author:        Etienne Grossmann  <etienne@isr.ist.utl.pt>
## Last modified: January 2000

function [r,c] = sub2ind(sz,ii)
  r = 1+rem(ii-1,sz(1));
  c = 1+floor((ii-1)/sz(1));

Produced by oct2html on Tue Apr 4 20:42:02 2000
Cross-Directory links are: ON