Esempio n. 1
0
        public static void CreateContourDataForMatlab(double[] x, double[] y, double[] z, int rows, int columns, string path)
        {
            double[,] xContour = new double[rows, columns];
            double[,] yContour = new double[rows, columns];
            double[,] zContour = new double[rows, columns];

            //int[] arr = Enumerable.Repeat(42, 10000).ToArray();

            //string[] yData = new string[rows];
            //string temp;
            //for (int i = 0; i < rows; i++)
            //{
            //    for (int j = 0; j < columns; j++)
            //    {
            //        yContour[i, j] = y[i *columns+ j];
            //    }
            //}
            xContour = VectorOperations.ConvertVectorToMatrix(x, rows, columns);
            yContour = VectorOperations.ConvertVectorToMatrix(y, rows, columns);
            zContour = VectorOperations.ConvertVectorToMatrix(z, rows, columns);

            //for (int i = 0; i < rows; i++)
            //{
            //    for (int j = 0; j < columns; j++)
            //    {
            //        yData[i] = yData[i] + "\t" + yContour[i, j];
            //    }
            //}
            //File.WriteAllLines(@"C:\Users\Public\Documents\ContourDataY.dat", yData);

            MatrixOperations.PrintMatrixToFile(xContour, path + "xData.dat");
            MatrixOperations.PrintMatrixToFile(yContour, path + "yData.dat");
            MatrixOperations.PrintMatrixToFile(zContour, path + "zData.dat");
        }