From 97a693d996c79fb2a008b19750d8bb45512e01a2 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Mon, 6 Feb 2017 11:26:44 -0500 Subject: Inital commit --- linear_spaced.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 linear_spaced.c (limited to 'linear_spaced.c') diff --git a/linear_spaced.c b/linear_spaced.c new file mode 100644 index 0000000..d8dd301 --- /dev/null +++ b/linear_spaced.c @@ -0,0 +1,33 @@ +/* File: linear_spaced.c + Generates linearly spaced atat for an array with N elements from x0 to xf*/ + +#include + +#define N 11 + +int main() +{ + double x[N], + x0 = 0.0, + xf = 5.0; + double j = x0; + + int i; + + printf("%-4c",'c'); + /* generate linearly spaced data for an array with N elements */ + double step = (xf - x0)/((double)N); + for(i=0;i