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
 LabTalk Forum
 cell data

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
moondream Posted - 09/25/2002 : 08:15:24 AM
Hi, all,

If x=0.5, how could i get y(0.5)=?

thanks,

moondream
5   L A T E S T    R E P L I E S    (Newest First)
Hideo Fujii Posted - 09/26/2002 : 11:10:41 AM
Hi,

quote:

but why couldn't I use col(b)(0.5)= ?



I always think that Origin's syntax for functions is like:
    <FUNCTION_NAME>(argument)
But, col(b) is not a function name, but data1_b is a "name".
For me, the form like col(b)(0.5) is very confusing, and may potentially cause an ambiguity (Is 0.5 the argument of "col"? or of "(b)"?).

--Hideo


moondream Posted - 09/26/2002 : 07:49:17 AM
Thanks all, all of it work.
but why couldn't I use col(b)(0.5)= ?


thanks again,

moondream
cpyang Posted - 09/25/2002 : 4:58:56 PM
The Table function is the best way to do this, using the data above,

table(data1_a, data1_b,2.5)=;
TABLE(DATA1_A, DATA1_B,2.5)=5
table(data1_b, data1_a,7)=;
TABLE(DATA1_B, DATA1_A,7)=3.5

so you get get x from y or get y from x easily.

CP


Barb Tobias Posted - 09/25/2002 : 4:34:01 PM
Here's some more information to consider...
You can also use the following notation in the Script window:
yDataSet(xValue) =
In this notation, Origin uses linear interpolation/extrapolation on the X data set and/or Y data set, as needed.
Example,
Data1 worksheet
A(X) B(Y)
1 2
2 4
3 6
4 8
Enter the following in the Script window:
data1_b(2)=
Origin returns 4.
Enter:
data1_b(2.5)=
Origin returns 5.
-Barb



Edited by - Barb Tobias on 09/25/2002 5:00:26 PM
Mike Buess Posted - 09/25/2002 : 1:07:48 PM
Hi moondream,

First, let's make sure I understand what you want to do. You want to find a value in a Y column based on its corresponding X value rather than its row number? If I'm wrong pls ignore the rest of this message and set me straight. If I'm right then read on.

In a typical worksheet with data1_A as the X column and data1_B as the Y column you can find the Y value who's X value is exactly 0.5 like this...

ii=list(0.5,data1_A) // find the first row with X value = 0.5
data1_B[ii]=; // type the corresponding Y value

If 0.5 is not found you'll get data1_B[0]=--. It's slightly more complicated to find the Y value who's X value is closest to 0.5, but it can be done using the xvalue() and xvalue1() functions. If that's what you need let me know and I'll explain later.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 09/25/2002 1:13:29 PM

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