Hello,
I translated your text from German to English using:
http://world.altavista.com/
and from what I read from the translation, you want the following:
Take a matrix that is (m rows x n cols) and make it a matrix with (m rows x n+1 cols) where the last col has the sum of cells in each row.
If this is what you want, here is code to do that.
Otherwise, please post again, and if possible, in English.
Easwar
OriginLab
void matrix_add_sum_column(string strMat)
{
// Declare matrix object with specified name and check validity
// Note: It is assumed here that the matrix is of type double
Matrix Mat(strMat);
if( !Mat )
{
printf("Invalid matrix: %s\n", strMat);
return;
}
// Create an new matrix and copy data from Original matrix;
matrix mat;
mat = Mat;
// Transpose new matrix, do sum and store in vector
// (Need to transpose because only SumColums method available now
// and no SumRows)
mat.Transpose();
vector vecSum;
mat.SumColumns(vecSum);
// Increase dimension of original matrix by one column,
// keeping orignal data where it is
int nRows, nCols;
nRows = Mat.GetNumRows();
nCols = Mat.GetNumCols();
Mat.SetSize(nRows, nCols + 1, TRUE);
// Copy summed vector to last column
Mat.SetColumn(vecSum, nCols);
}