Code covered by the BSD License
-
COUNT(X)
% COUNT Counts the number of different elements.
-
Y =addpaths(varargin)
% ADDPATHS Adds directory to search path (accepts cells and matrix)
-
Y=pad(varargin)
-
Y=shift(varargin)
SHIFT Shifts matrix elements.
-
cmap(varargin)
CMAP Creates colormap
-
colormapc(varargin)
COLORMAPC Circular colormap
-
colormaps(varargin)
COLORMAPS Symmetrical colormap
-
extreme(X,varargin)
EXTREME Sets/Gets matrix extremum values.
-
fft2fix(X)
FFT2FIX2 Fixes FFT2 graphic
-
gmax(X)
-
gmin(x)
-
grow(varargin)
-
imagem(varargin)
IMAGEM Displays image and marker.
-
ind2subm(SIZ,IND)
IND2SUBM Multiple subscripts from linear index.
-
invert(X)
-
iscol(X)
-
iseven(X)
-
isint(X)
-
isodd(X)
-
isrow(X)
-
limindex(X, I, F)
% LIMINDEX Extracts matrix elements by limiting indexes.
-
lind2cell(I, F)
% LIND2CELL Converts limiting indexes to cell.
-
lind2str(I, F)
% LIND2STR Converts limiting indexes to string.
-
maxfilt2(X,varargin)
MAXFILT2 Two-dimensional max filter
-
minfilt2(X,varargin)
MINFILT2 Two-dimensional min filter
-
mmax(varargin)
MMAX Multi matrix maximum.
-
mmin(varargin)
MMIN Multi matrix minimum.
-
nfft(varargin)
NFFT Discrete Fourier transform.
-
nfft2(varargin)
% NFFT2 Two-dimensional discrete Fourier Transform.
-
noise(varargin)
-
normn(X,P,DIM)
-
plotcolor(x)
PLOTCOLOR Returns plot color strings
-
plotline(x,d,varargin)
PLOTLINE Plots a vertical or horizontal line
-
posterize(varargin)
% POSTERIZE Reduces number of colors in an image.
-
quote(varargin)
-
resize(varargin)
-
rmaths(X)
% RMPATHS Remove directory to search path (accepts cells and matrix)
-
roll(varargin)
ROLL Rolls matrix elements.
-
scale(varargin)
SCALE Scales matrix elements to a new range.
-
shrink(X,E)
-
subdim(X,N,DIM)
SUBDIM Extracts matrix elements by dimension
-
subdirs(varargin)
% SUBDIRS Returns the subdirectories of a directory
-
thomas(varargin)
THOMAS Solves a tridiagonal linear system
-
toggle(varargin)
TOGGLE Matrix elements classification.
-
vanherk(X,N,TYPE,varargin)
-
contents.m
-
View all files
from
General Extra Toolbox
by Frederico D'Almeida
Generic functions for matrix manipulation, image processing, etc.
|
| ind2subm(SIZ,IND)
|
function I = ind2subm(SIZ,IND)
% IND2SUBM Multiple subscripts from linear index.
%
% IND2SUBM is used to determine the equivalent subscript values
% corresponding to a given single index into an array.
%
% I = IND2SUBM(SIZ,IND) returns the matrix I containing in each row
% all the subscripts of the corresponding index IND.
%
% The only difference between IND2SUBM and IND2SUB is that, in IND2SUBM,
% only one output is produced, independently of the number of dimensions
% involved. This is useful when writting functions that must support
% multidimensional matrix.
%
if size(IND,1)==1 & size(IND,2)>1
IND = IND';
end
I = zeros( length(IND),length(SIZ) );
IND = IND - 1;
for dim = length(SIZ) : -1 : 2
p = prod(SIZ(1:dim-1));
I(:,dim) = floor(IND/p);
IND = IND - I(:,dim)*p;
end
I(:,1) = IND;
I = I+1;
|
|
Contact us