Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


gind2sub.m File Reference

Go to the source code of this file.


Functions

 if (length(ndx)~=1)
 fprintf (1,'Error zind2sub:length(IND) must be 1\n')
for for v (i)

Variables

 function [err, v]
Bethesda MD Define the function
name for easy referencing 
FuncName = 'gind2sub'
Debug Flag DBG = 1
initailize return variables err = 1
 v = [ones(1,length(sz))]
 return
end n = length(sz)
 k = [1 cumprod(sz(1:end-1))]
 ndx = ndx - 1
for i = n:-1:1

Function Documentation

fprintf ,
'Error zind2sub:length(IND) must be 1\n
 

if length(ndx)~  = 1  ) 
 

for for v  ) 
 


Variable Documentation

Debug Flag DBG = 1
 

Definition at line 33 of file gind2sub.m.

end err = 1
 

Definition at line 54 of file gind2sub.m.

Bethesda MD Define the function name for easy referencing FuncName = 'gind2sub'
 

Definition at line 30 of file gind2sub.m.

function[err, v]
 

Initial value:

 gind2sub (sz, ndx)
%
%   [err,] = gind2sub ()
%
%Purpose:
%   This function converts a linear index to multiple subscripts based on the dimensions.
%   It is a further modified version from Ziad's modification based on the original Matlab 
%   function IND2SUB. The difference from what Ziad did is that we vary the subscript starting
%   from the last dimension and ends with the first dimension instead of the other way around.
%   
%Input Parameters:
%   sz: dimension vector
%   ndx: counter index for the total number of combinations.
%   
%Output Parameters:
%   err : 0 No Problem
%       : 1  Problems
%   v: array of subscripts  
%      
%Key Terms:
%   
%More Info :
%
%     Author : Gang Chen
%     Date : Tue Dec 23 10:57:48 EST 2003
%     SSCC/NIMH/ National Institutes of Health

Definition at line 1 of file gind2sub.m.

for for i = n:-1:1
 

Definition at line 49 of file gind2sub.m.

k = [1 cumprod(sz(1:end-1))]
 

Definition at line 46 of file gind2sub.m.

end n = length(sz)
 

Definition at line 45 of file gind2sub.m.

ndx = ndx - 1
 

Definition at line 51 of file gind2sub.m.

Referenced by drawtriangle(), glutGetColor(), and glutSetColor().

return
 

Definition at line 55 of file gind2sub.m.

v = [ones(1,length(sz))]
 

Definition at line 41 of file gind2sub.m.

 

Powered by Plone

This site conforms to the following standards: