CSharp examples for System:Array Calculation
Performs addition on two arrays
using System.Linq; using System.Collections.Generic; using System;/*from ww w . ja v a2 s .co m*/ public class Main{ /// <summary> /// Performs addition on two arrays /// </summary> /// <returns></returns> public static double[] ArrayAdd(this double[] array1, double[] array2) { var newArray = new double[array1.Length]; for (int i = 0; i < array1.Length; i++) { newArray[i] = array1[i] + array2[i]; } return newArray; } }