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
 Origin Forum
 Insert values of variable to column cells

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
pwpelk Posted - 10/16/2017 : 05:53:06 AM
/Origin 9.1
I want to compute differenc between data in column and write the data to a new column. I use loop and range variable to compute the difference as:

for(i = 1, j = 11; i<6 ; i++; j--)
{
range Vm=1[i];
range Vp=1[j-1];
Vp-Vm=;

col(3)=(Vp-Vm);
}

It computes and displays the difference but not writing data to the column

Please help
4   L A T E S T    R E P L I E S    (Newest First)
pwpelk Posted - 10/18/2017 : 08:01:23 AM
Dear Aviel,

No it works.

Thanks a lot.

Piotr
arstern Posted - 10/17/2017 : 09:05:36 AM
Hi,

I apologize. Please try,

for(ii = 1, jj = 11; ii<6 ; ii++; jj--)
{
range Vm=1[ii];
range Vp=1[jj-1];
Vp-Vm=;

col(3)[$(ii)]=col(1)[$(jj-1)]-col(1)[$(ii)];
}

Aviel
pwpelk Posted - 10/17/2017 : 06:23:26 AM
Thanks for the suggestion but the script writes not the difference but only every second vaules of the column cells.
See below

for(ii = 1, jj = 11; ii<6 ; ii++; jj--)
{
range Vm=1[ii];
range Vp=1[jj-1];
Vp-Vm=;
col(3)[$(ii)]=col(1)[$(jj-1)-$(ii)];
};
For data in col(1)
2
6
10
14
18
22
26
30
34
38
--------------------
It should be
Vp-Vm=36
Vp-Vm=28
Vp-Vm=20
Vp-Vm=12
Vp-Vm=4;
--------------------
but it gives ;
34
26
18
10
2;
It looks as if it picks every second cell value.
Please help.

Piotr
AGH University
arstern Posted - 10/16/2017 : 3:41:03 PM
Hi,

Please try:

for(ii = 1, jj = 11; ii<6 ; ii++; jj--)
{
col(3)[$(ii)]=col(1)[$(jj-1)-$(ii)];
}


Thanks,
Aviel
OriginLab

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