function [R]=addIndex(M) % addIndex(M) -- Adds an index column as the first column in a matrix % Adds an index column as the first column in a matrix % Created by Jim Work, University of South Carolina, August 13, 2003 MatrixLength = length(M); FinalIndex = transpose([1:MatrixLength]); R = [FinalIndex, M];