Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
In the attached MathCAD 14 worksheet, I am attempting to create a counter "v" that counts the number of times a value in an array c.a is below 1.5*hef. Is this something easy to do? I have attempted to do this with a "for" function but am not recieving the result I'm looking for.
Solved! Go to Solution.
I wasn't sure what you wanted. Two guesses enclosed. The relevant part is copied as a picture, additional comments included in the attached Mathcad sheet.
- Guy
PS Note that the vectors (and counter) start at j=0, though your first definition of c(sub)a begins with j=1 ... even though you define ORIGIN=0.
I wasn't sure what you wanted. Two guesses enclosed. The relevant part is copied as a picture, additional comments included in the attached Mathcad sheet.
- Guy
PS Note that the vectors (and counter) start at j=0, though your first definition of c(sub)a begins with j=1 ... even though you define ORIGIN=0.
You may achieve the same results as shown by Guy using for-loops more compact that way:
Are you aware that your vector c.a contains 5 elements? Because ORIGIN is 0 (and thats a reasonable default value anyway) and you defined beginning from c.a[1, the first element is (default) 0. If thats not on purpose I would suggest you begin your definitions with c.a[0 instead if c.a[1. Second best is setting ORIGIN to 1.