| T O P I C R E V I E W |
| 22111967 |
Posted - 04/24/2008 : 10:33:42 AM Origin Version (Select Help-->About Origin): 7.5 Operating System:XP
This procedure:
double to_degr( double x ) { double pix = 3.1415926; return x / pix * 180; }
void prevod2() { Worksheet wks = Project.ActiveLayer(); Dataset a, b, c, d, e, f, g, h;
a.Attach(wks, 0); b.Attach(wks, 1); c.Attach(wks, 2); d.Attach(wks, 3); e.Attach(wks, 4); f.Attach(wks, 5); g.Attach(wks, 6); h.Attach(wks, 7);
unsigned int pocet_riadkov = a.GetSize(); double sucet = 0; double pix = 3.1415926;
for( unsigned int i = 0; i < pocet_riadkov ; i++ ) {
double tmp = atan( abs( b[i] / a[i] ) ); if ( (a[ i ] > 0) && (b[ i ] > 0) ) { e[ i ] = tmp; } if ( (a[ i ] < 0) && (b[ i ] > 0 )) { e[ i ] = pix - tmp; } if ( (a[ i ] < 0) && (b[ i ] < 0 )) { e[ i ] = - pix + tmp; } if ( (a[ i ] > 0) && (b[ i ] < 0 )) { e[ i ] = - tmp; }
d[i] = sqrt( a[i]*a[i] + b[i]*b[i] ); f[i] = to_degr( e[i] ); }
printf("fin!\n"); }
working up to [i] = 9957 and after turn off with "Error: Failed to execute script" Number of rows is 40 000.
You have some idea, please ??
jan
|
| 1 L A T E S T R E P L I E S (Newest First) |
| Echo_Chu |
Posted - 04/30/2008 : 05:04:01 AM Hi, Jan,
I have filled 40000 random number to first 8 columns and run your code.It has no problem. The problem might be caused by your data file. Would you mind to send it to us and let's look into it?
Echo OriginLab Corp |
|
|