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
Solved! Go to Solution.
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.)
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!!!
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.