| 
    
    | 
   
   
     
An  application of using the original 
distribution of NAG library.
 
In a Ch shell or Ch IDE, run the following command:
 
  ch g02brce.c < g02brce.d 
You will get the output:
 
 
g02brc Example Program Results
Correlation coefficients:
 1.00000  0.85714  0.12849
 0.71429  1.00000  0.33040
 0.10287  0.41148  1.00000
 
 
  The contents for files g02brce.c and g02brce.d are listed below.
 
/* nag_ken_spe_corr_coeff(g02brc) Example Program
 *
 * Copyright 1992 Numerical Algorithms Group.
 *
 * Mark 3, 1993.
 */
#include 
#include 
#include 
#include 
#define NMAX 20
#define MMAX 20
int main(void)
{
  Integer i, j, m, n, tdx, tdc;
  double x[NMAX][MMAX], corr[MMAX][MMAX];
  Integer svar[MMAX], sobs[NMAX];
  Integer *svarptr, *sobsptr;
  char s, w;
  tdx = MMAX;
  tdc = MMAX;
  Vprintf("g02brc Example Program Results\n");
  /* Skip heading in data file */
  Vscanf(" %*[^\n]");
  /* Read data */
  Vscanf("%ld%ld\n",&m,&n);
  if (m>=1 && m<=MMAX && n>=1 && n<=NMAX)
    {
      for (i=0; i
 
The content of 
file "g02brc.d" is as follows.
 
g02brc Example Program Data
3 7
1.0 2.0 4.0
7.0 7.0 3.0
2.0 3.0 4.0
4.0 4.0 5.0
5.0 6.0 7.0 
3.0 1.0 3.0
6.0 5.0 5.0
s 1 1 1
w 1 1 1 1 1 1 1
 |