Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
Hello.
I am trying to extract values from a matrix according to certain restrictions, with no success! In the file attached is the attempt. Any help would be greatly appreciated.
Solved! Go to Solution.
From a quick observation:
You can remove i from your program altogether, and use j to index r.
But the problem lies in the fact that only the first if statement is within the for loop.
I think you want all three if statements in that loop.
Success!
Luc
Hi.
Thank you, but I think I wasn't very clear. This is what I am trying to do:
From a quick observation:
You can remove i from your program altogether, and use j to index r.
But the problem lies in the fact that only the first if statement is within the for loop.
I think you want all three if statements in that loop.
Success!
Luc
Thanks a lot, Luc!
It worked!
You can use the logic operators as follows:
Alan
Thanks, Alan. It's simpler this way!
Here are some more ways using vectorized function calls: