Origin Code Builder

Posted on 2004-10-17
Last Modified: 2010-04-15
What's wrong with this code:
//      Program to calculate the skewness and kurtosis of BMD for
//      each level of AGE within an Origin WORKSHEET, and
//      to place these results back inside the same worksheet.
//      The statistics are calculated using a NAG routine.

void  DSXXX()
      double xsd,xskew, xkurt, wsum, xmean, xmax, xmin;
      double * wt;
      int success, i, weight, nvalid = 10;
      wt = NULL;
      Dataset xx("Data1",2);
      //Dataset cannot be used as a parameter, but vector can.
      vector x = xx;
      success = nag_summary_stats_1var(nvalid, x, wt, &nvalid, &xmean, &xsd, &xskew,
            &xkurt, &xmin, &xmax, &wsum);

         printf("Number of cases is %d\n", nvalid);
         printf("And there is no weight\n");
         printf("The input is following : x=\n");
         for(i=0; i<10; i++)
            printf("%10.1f", x[i]);
            if((i+1)%10 == 0)
      printf("\nsuccess is%d\n", success);
      if(success == 0)
            printf("\nsucessfully call of the nag_summary_stats_1var function\n");
            printf("the output is following:\n");
            printf("No of valid cases         %10d\n", nvalid);
            printf("mean                      %10.1f\n", xmean);
            printf("std devn                  %10.1f\n", xsd);
            printf("Skewness                  %10.1f\n", xskew);
            printf("Kurtosis                  %10.1f\n", xkurt);
            printf("Minimun                   %10.1f\n", xmin);
            printf("Maximum                   %10.1f\n", xmax);
            printf("Sum of weights            %10.1f\n", wsum);
            printf(" \n There are some problems.");

Question by:almaha

Accepted Solution

van_dy earned 250 total points
ID: 12332199
Please clarify what are u doing here :-

/* ---------------- */
     Dataset xx("Data1",2);
     //Dataset cannot be used as a parameter, but vector can.
     vector x = xx;
/* ----------------- */

is Dataset some class? what is vector? are u doing c++? Well, in that case if Dataset is a type,
may be you cannot just do

vector x = xx;    

unless you overload the '=' operator. please clarify this.


Author Comment

ID: 12392725
its ok.
i solved the problem.

but i'm facing lots of barriers. i would like to get some help in this section. OriginLab, originPro 7.5 Scripting << which is in C Language.

if anyone have been programming in this area please let me know.

thanks alot

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
memory mapped I/O query 6 147
undefined reference to `bswap_128' 9 164
Which checksum is this? 7 144
Read file descriptor 3 in C 14 107
Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
This tutorial is posted by Aaron Wojnowski, administrator at  To view more iPhone tutorials, visit This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question