Bar Info
Menu
Debugging
Menu
Derivatives
Menu
Matrix Handling
Menu
Price Rounding
Menu
Regression Lines
Menu
Statistics
Menu
User Tracking
Menu
Example Strategies
Menu
Transpose Matrix
Description:
Transpose a matrix.
Syntax:
Transpose(double[,] matrix);
Arguments:
matrix: The matrix that needs to be transposed.
///
/// Transposes a 2d array.
///
/// The array that is to be transposed.
/// An array that is the transposed version of the recieved array.
private double[,] Transpose(double[,] matrix)
{
// save the dimentions of the array based on the size of the trasposed version of the array
int row = matrix.GetLength(1);
int col = matrix.GetLength(0);
// set the size of the transposed array
double[,] matrixT = new double[row, col];
// save each value as the reverse of its original placement
for (int i = 0; i < row; i++)
for (int j = 0; j < col; j++)
matrixT[i, j] = matrix[j, i];
return matrixT;
}