cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Using Lookup Function in Program

avarma
1-Newbie

Using Lookup Function in Program

Hello Guys,

I have a problem in my mathcad program.

I was trying to use lookup function in a loop, Attached is the file illustrating my problem.

I was able to use lookup function and get the desired output, but when I have used the same function in a program, I was not getting any errors but it was giving the output as [1,1].

I was still a learner of mathcad and not able figure it out. Could any one plaese help me to resolve this issue, May be my example I have attached here is smaller one, but my real problem contains huge matrix and I need to use lookup function (or if any other) in program to get the desired output.

Thanks a ton for your help!!

Ashok

1 ACCEPTED SOLUTION

Accepted Solutions
Fred_Kohlhepp
23-Emerald I
(To:avarma)

The lookup function is set up to return a vector (in case there are more than one matches to the value you're looking for. The [1,1] is telling you that there is a one element array answer. Try putting "[0" immediately after the lookup function (asking for the first element of the vector.)

View solution in original post

4 REPLIES 4
Fred_Kohlhepp
23-Emerald I
(To:avarma)

The lookup function is set up to return a vector (in case there are more than one matches to the value you're looking for. The [1,1] is telling you that there is a one element array answer. Try putting "[0" immediately after the lookup function (asking for the first element of the vector.)

It is working now.

Thanka a lot Fred!!!

Werner_E
24-Ruby V
(To:avarma)

Fred has already explained the reason for the behaviour you are experiencing and how to deal with it.

See the attached file for some more details.

Thanks a lot Werner for your help.

Top Tags