Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
Hi there ,
I'm trying to find the q values that correspond to levels values . Knowing that q was measured from z which include the levels values as well . like the example
Thanks in advance
Solved! Go to Solution.
Obviously you attached the wrong sheet again - I see neither a vector "levels" nor a vector "q" with ascendant values in your sheet.
In the meantime I got even more confused as now I am not sure what the input and what the output should be.
Could it be that you are just looking for something like this - a vector with the q.cza (not just q) values corresponding to the depths in the vector ztips (and not levels!) ?:
Knowing that q was measured from z which include the levels values as well . like the example
????????????????????????????????????
There is no example which would make it any clearer and there is no q, neither a scalar nor a vector in your worksheet!!??
If q is the second column of the data you read in (unit MPa), then it can be seen that the values are not in ascending order. So one specific q-value like 32 MPa could be assigned to a lot of different depth values in d which then correspond to different 'level' (however you would like to define a 'level').
Please be more specific as to what you are trying to achieve and give some concrete numeric examples in the Prime worksheet - by this I mean trhat you clearly should name the vectors being involved, name the specific numeric value(s) you choose as input example and also name the result you expect. And if the result is a level number, you should also explain why its this number and how we would arrive at it.
You may also want to look up the syntax of the "lookup" function in the help and compare with your usage of it.
The second and third arguments must be both vectors(!) of equal dimension, the first one usually is a scalar value.
Hi Werner ...
The result I want is the q in the levels I specified....
what I have in hand is q in all depths .. but I need only the q in some depths( levels)
in the worksheet I have 3670 depths and only 43 level ...
I want to filter q to get only the ones corresponding to the levels
the answer I want incluld only the q values
see here
the first level is the same of z(1632) I need to get that q in the same depth
Obviously you attached the wrong sheet again - I see neither a vector "levels" nor a vector "q" with ascendant values in your sheet.
In the meantime I got even more confused as now I am not sure what the input and what the output should be.
Could it be that you are just looking for something like this - a vector with the q.cza (not just q) values corresponding to the depths in the vector ztips (and not levels!) ?:
Hi Werner,
this is my original sheet using the program you proposed I get qztips.. however when I tried to loop it it shows errors , Then
I tried to loop the function the way you showed me before :
The is not the result I was waiting for ... I should have Re just 43 value in each row.. what I get when I open the 43 is another 42 values which is wrong .. it should be only 43 and not another 42 inside it .. .. when deleting the loop it also shows error
can you help me fix that ?
page 14 prime 10
Thanks in advance
You see me clueless!
had just a look at the screenshot and I can't see in which way the picture you show would have to do with your initial question here or with my guess above.
I don't know why you expected a different result from your calculation than the highly nested vector.
Your program creates a matrix R with the very same structure as the first argument "a" and the elements of this are the results of the calculation which uses the second argument "b".
When you call this function, "a" is a 3x1 vector consisting of 43x1 vectors of scalars.
So the result R has the same structure, but because "b" is not a scalar but rather a 42x1 vector, your total result is a 3x1 vector consisting of 43x1 vectors consisting of 42x1 vectors of scalars.
In other words you calculate 3*43*42=5418 values and one would have to be a clairvoyant to know which 43 (or 3*43 ??) of these values you would like to see as your desired result.
Hi Werner,
Well the result should be 3*42 >>> Because what I'm doing is dividing the first row of (a) which contains 43 elements by b ( which also contains 43 but I wrote the program wrong it shows only 42 elements) it uses b wrongly. ...
What the result I got shows is > it divids the first row of a ( which is q matrix of 43 elements and divides the first element of q by all b values) like 42 times
and then goes to the second row of the 43 in and divides it by all b elements
....(a) matrix contains (q,q2,q3) and all of them are values share the same depth with b ... so I need q divide by b >> first of q matrix with the first of b matric .... not the first of q divided by all b values >>> q2/b >> q3/b
what I need is the first value of a which is ( q matric to be divided by b >> first of q with the first of b >> because both of the them are values in the same depth ) and then the second of q with the second of b .... until the last value of q43)
After that it goes to q2 which is the second matric of a .. it should divide the first of q2 by the first of b and the second of q2 with the second of b and so on ....
The way you had written it with the two nested loops you divide each of the 43 elements in each of the 3 elements of a by the vector b.
sigma.. which you used as second function argument only has 42 and not 43 elements.
If it had 43, you could omit the inner loop with j and possibly get what you expect.
Werner ,
Thank you and sorry for bothering you with same questions >> sometimes its hard even to see the obvious
your help is highly appreciated .
Yusra