levicivita

The levi civita symbol
696 Downloads
Updated 28 Jan 2010

View License

% levicivita
% e = levicivita(I,Dim)
%
% Returns the levi civiata of the input indices. When Dim == 1, each
% column is seen as a vector of indices. When Dim == 2, each row is seen
% as a vector of indices. Dim defaults to 1 when unspecified.
%
% levi civiata is defined as follows
% | -1 if indices are an odd permutation. i.e. [1,3,2], [3,2,1],...
% e = | +1 if indices are an even permutation. i.e [1,2,3], [3,1,2],...
% | 0 if any of the indices are equal. i.e. [1,1,1], [3,2,2],...
%
% Example
% [I{1:3}] = ndgrid(1:3,1:3,1:3); % All 3D subscripts
% I = [I{1}(:) I{2}(:) I{3}(:)]; % 3D subscripts, i,j,k
% e = levicivita(I,2) % Levi civiata for 3D
%
% levicivita([1 2 3 4].') % Levi civiata for 4D
%
% See also
% levicivita permutationparity
%

Cite As

Pierce Brady (2024). levicivita (https://www.mathworks.com/matlabcentral/fileexchange/26515-levicivita), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2009b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0