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
 how to set column value for a set length

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
ywh Posted - 11/07/2014 : 5:42:16 PM
Origin Ver. and Service Release (Select Help-->About Origin): 9.0
Operating System: Windows 7

I'm new to Origin and would like some help on this task.

I have a column of numbers Col(A), mostly 1s, a few 10s and 0s. The 10s and 0s are flags. I want to set numbers in Col(B) based on these flags. If Col(A)[1] is 10, then I want to set Col(B)[1] through Col(B)[250] to be 1. If Col(A)[1000] is 0, then I want to set Col(B)[1000] through Col(B)[1500] to 2. The rest will be 0.

How do I achieve setting the new column value for a certain length either using "Set Column Value" or other scripts?

Thanks a lot!
2   L A T E S T    R E P L I E S    (Newest First)
ywh Posted - 11/12/2014 : 3:00:04 PM
Hi Greg:
Thanks a lot! I realized that "Set Column Values" is probably insufficient to achieve the goal, so I'm switching to LabTalk now.
Thanks!
greg Posted - 11/10/2014 : 11:27:54 AM
You have asked for two non-exclusive conditions each with separate ranges so Set Column Values would need to be used three times.
The first would fill the full range of column B with zero. (From = 1, To = whatever needed)
Next, for rows 1 to 250 you could use the expression
col(A)[1]==10?1:0
Finally, for rows 1000 to 1500 you could use the expression
col(A)[1000]==0?2:0

Of course LabTalk could be used for a programmed solution.

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