The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 integ 1 deletes x values

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Phillip T. Posted - 08/30/2022 : 03:14:54 AM
Hello,
I have an issue with the integ1 function not working (giving 0 as all result values) and deleting my x values in the process. Weirdly I used almost the same skript on other datasets and it worked; although also deleting the x-axis values.

//START CODE

IRno= 128; //$([%H]IR!wks.nCols);
newsheet name:= integration;
//range IRtime = [%H]IRintnorm!col(A);
//col(A)= IRtime;
col(A)[L]$ = IR Time;

//highWN = 3808;
//lowWN = 3625;
sheet$ = IRintnorm;
comment$ = "";
Intno = 1;

wks.addcol();

getn
(high WN) highWN
(low WN) lowWN
(Integration No.) Intno
(Sheet) sheet$
(comment) comment$;


page.active$ = %(sheet$);

loop(ii,1,wks.nRows) {

if($([%H]%(sheet$)!cell($(ii),1)) < $(highWN)){

highCN = $(ii);

};

if($([%H]%(sheet$)!cell($(ii),1)) < $(lowWN)){

lowCN = $(ii);

};

};

//type -b "$(IRno)";

page.active$ = integration;
colno = $(intno)+1;

col($(colno))[L]$ = "$(highWN)"+"-"+"$(lowWN)"+"%(comment$)";


loop(ii,2,$(IRno)) {

integ1 iy:= [%H]%(sheet$)!(col(A),col($(ii)))[$(highCN):$(lowCN)] baseline:=1;

jj= $(ii)-1;
[%H]integration!cell($(jj),$(colno)) = $(integ1.area);

};



intno= $(intno) +1;

//END CODE

Regards,
Phillip
4   L A T E S T    R E P L I E S    (Newest First)
Phillip T. Posted - 09/01/2022 : 05:01:08 AM
Ah right. The data in my other files was ordered the other way around

Thank you.
YimingChen Posted - 08/31/2022 : 09:26:15 AM
In the line below, are you sure highCN value is smaller than lowCN. Otherwise, the input range is falsely defined.
integ1 iy:= [%H]%(sheet$)!(col(A),col($(ii)))[$(highCN):$(lowCN)] baseline:=1;

Second, can you remove [%H] in the line:
[%H]integration!cell($(jj),$(colno)) = $(integ1.area);

James
Phillip T. Posted - 08/31/2022 : 02:05:04 AM
Sure here you go:

https://drive.google.com/drive/folders/1Vd74YV8hocm4zVbdAelmsT1ponWRu03C?usp=sharing

I imported all files into one sheet and deleted all X axis exept the first.
YimingChen Posted - 08/30/2022 : 12:13:27 PM
Can you provide some sample data for us to test? I couldn't reproduce the issue. Thanks.

James

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000