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
 Origin C creating 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
zknauss Posted - 09/20/2022 : 3:54:52 PM
Using origin C script I need to create a sheet indexing the row number of entries in each column of another worksheet. I've included a picture of what I'm trying to accomplish via the script.

Thanks!

https://www.dropbox.com/s/vy4ca623y8i664v/Capture.PNG?dl=0
https://www.dropbox.com/s/4b5oflskd4i71j8/Capture2.PNG?dl=0

ZTK
9   L A T E S T    R E P L I E S    (Newest First)
zknauss Posted - 09/23/2022 : 10:01:11 AM
Figured it out had to set all the columns as "Y" should be all set!

ZTK
zknauss Posted - 09/23/2022 : 09:50:32 AM
Ok I'm really close The below script works for the first column but then it directly copies the "Y" data for every column then after.

for (int i = 1; i <= wks.ncols; i++ ) { range yy = [NCONT1Peak]"Center Max"!$(i); wcol(i) = xof(yy); }

ZTK
zknauss Posted - 09/23/2022 : 09:32:21 AM
what is the i or ii < 4 for shouldn't this be i<= "#rows containing a value"? I have 649+ columns with 1-250+ rows used per column so my goal is to do this automatically with no user input

ZTK
zknauss Posted - 09/22/2022 : 1:10:58 PM
No sorry if anyting thats a lot harder lets stick to just creating a peak index page. I have about 35 equations which need to utilize the peak index number I'd prefer not to recode everything and just buld the page if possible.

ZTK
cpyang Posted - 09/22/2022 : 12:56:33 PM

for(ii=1;ii<4;ii++) {
  wcol(3)[ii]=total(col(A)[ii:ii+1]);
}


Something like this?

CP
zknauss Posted - 09/22/2022 : 11:42:09 AM
Alternitivly if theres a way of using a row # in a function or math formula, such as wcol(i)[#] = total((row#-#)^2), that would also work.

ZTK
zknauss Posted - 09/22/2022 : 11:25:46 AM
What I'm trying to do it manually create a peak index so that I can perform a spacific statistical test that is using the peak # as its X value. What I need the code to do is say if in column 1 of my Y data I have 2 entries (two peaks/rows of data) column 1 in a sheet named peak index will display a 1 in row one and a 2 in row two. Then it will move to column 2 repeat this process. The number of peaks in my data sets can vary from two to several hundred so it needs to be dynamic.

ZTK
cpyang Posted - 09/21/2022 : 5:50:19 PM
I don't really understand what you are trying to do, but I tried XValue function and it works as expected.

I setup a worksheet named "YData" and it has A(x) B(y), and I put some values into A(x), then the following code

i = 2;
range rr = YData!wcol(i);
for(int ii = 1; ii < 4; ii++) {
	x = xvalue(ii, rr);
	x = ;
}

generated the correct values in A(x).

CP
zknauss Posted - 09/21/2022 : 10:14:09 AM
So I think for this the Xvalue() function should work I've written the following script but its giving an x index of a column # instead of going column by column and creating a x index of each used row. I tried rewriting it to see the full colomn but it just produces an error or I get really crazy outputs.

for (int i = 1; i <= wks.ncols; i++ ) { range xx = YData!$(i) ; wcol(i)[1] = Xvalue(i,xx) }




ZTK

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