Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
I have two vectors .. ztop and z
ztop shows the depth of each layer (cumulative value of z in each layer) . ztop has 11 values
z shows points in that depth .. it approximately increases by 0.02 in each layer. ( it has 3670 values)
each layer has its gamma and its ztop .. ( both have 11 values)
what I need is to write a program that will repeat gamma values for each z
so I get the 3670 gamma values .
In the first layer instead of having one gamma( 17 kN/m3) one value for all the layer , I need to get a vector which repeat this gamma as many as z in this particular layer .. and do the same for the rest layers.
Can you help me with that?
Solved! Go to Solution.
Do you mean something like this?
But why would you need to do that? I've probably misunderstood what you need!
Alan
@YA_10963798 wrote:
Well, I need to do that to satisfy the European code reiquirements. hhhhhh if it was for me I don't want to do it at all
What I mean is why not just use the scalar values in the calculations at each level without constructing a large vector of repeated values? It seems incredibly inefficient!!
after this calculation , I need to use another fuction which requires all the variables to have the same dimensions and type.
Thank you for your help. I will try it right now
can you please attach the sheet ?
shows points in that depth .. it approximately increases by 0.02 in each layer. ( it has 3670 values)
No, z has only 3669 values and the increment is not approx. 0.02 but exactly 0.01 m !
Hope you have not typed in all those values manually but rather copied them from an Excel sheet 🙂
So you want to use the exact gamma value for the layer and do not want gamma to be interpolated?
So maybe this could help:
BTW, it would be much easier to create the vector z either using a range and convert it to a vector or create the vector directly using a small program.
You may also use a worksheet range variable instead of the program with the for-loop, but I would prefer the programmed variant
BTW, even though you did in previous threads, you should always state which version of Prime you are using if its not the latest. You can avoid that way to be sent a file you can't open.
Is there any special reason why you don't simply use
Maybe additionally adding a "break" after the assignment for increased efficiency.
How did you manage to scroll all three vectors to the very same position?
I never succeed doing so as those silly sliders are much to inaccurate and as far as I have seen its not possible to use the keyboard.
How did you manage to scroll all three vectors to the very same position?
I never succeed doing so as those silly sliders are much to inaccurate and as far as I have seen its not possible to use the keyboard.
I agree @Werner_E navigating these large vrctors is a difficult process. Getting them lined up requires a steady hand on the mouse and plenty of patience.
Cheers
Terry
@terryhendicott wrote:
How did you manage to scroll all three vectors to the very same position?
I never succeed doing so as those silly sliders are much to inaccurate and as far as I have seen its not possible to use the keyboard.
I agree @Werner_E navigating these large vrctors is a difficult process. Getting them lined up requires a steady hand on the mouse and plenty of patience.
Cheers
Terry
Thanks, I was hoping for a more sensible method that I may have overlooked.
Hi Werner,
Thank you for your help
but it shows this in my laptob
What I need is to have a vector of gamma for each z point .. for example the first layer depth is 1.3 m (ztop) and this layer's gamma is 17 KN/m3.
this same layer has( let's say )20 z points ..I need to create a program to give me 20 gamma ( writting 17 for 20 times) and then the second layer gamma is 10.1 kN/m and has 15 z points..I need to have 10.1 gamma value for each z point in the second layer.
Just breaking the ztop gamma values to z
Hi,
Thats what my two functions do.
Cheers
Terry
Thank you so much Terry
Yes, thats what my approach does.
Here you see the switch from one layer to the other:
Can't explain why yo get the question marks when you open my file ??
Have yo tried to let the sheet recalculate (F5, F9).
Is there any error message?
BTW, I have no experience in your field of work. Looking at Terry's appraoch it appears to me that it cold be that you rather should use
You'll know anyway
Yes thank you so much
Here's another way to solve your problem. Using local functions may help with future problems of this nature.
Stuart
The worksheet is in Mathcad Prime 10 format, I'm afraid, not MP9.