Skip to content

Commit 0a7b50f

Browse files
fix: Update example.c
Signed-off-by: Dhruv/ <[email protected]>
1 parent 0c32ffc commit 0a7b50f

File tree

1 file changed

+7
-1
lines changed
  • lib/node_modules/@stdlib/stats/base/dmeanpn/examples/c

1 file changed

+7
-1
lines changed

lib/node_modules/@stdlib/stats/base/dmeanpn/examples/c/example.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,14 @@ int main( void ) {
2323
// Create a strided array:
2424
const double x[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 };
2525

26+
// Specify the number of elements:
27+
const int N = 4;
28+
29+
// Specify the stride length:
30+
const int strideX = 2;
31+
2632
// Compute the arithmetic mean:
27-
double v = stdlib_strided_dmeanpn( 4, x, 2 );
33+
double v = stdlib_strided_dmeanpn( N, x, strideX );
2834

2935
// Print the result:
3036
printf( "mean: %lf\n", v );

0 commit comments

Comments
 (0)