I have following inputs:
double zmin;
double zmax;
int count;
int N; //Total number of element in result array
I want to generate a sequence of double array with zmin as first and zmax as last value. But from second value until last but one it should be steзped by (zmax-zmin)/count.
Example:
zmin = 1;
zmax = 10;
count = 3
Expected result:
double[] result = { 1, 4, 7, 10}
My try:
double[] result = Enumerable.Repeat(zmin, N).Select(iv => (iv +(zmax-zmin)/count)).ToArray();
1 Answer