Extracting values in a matrix
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Extracting values in a matrix
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.
- Labels:
-
Other
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi.
Thank you, but I think I wasn't very clear. This is what I am trying to do:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks a lot, Luc!
It worked!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You can use the logic operators as follows:
Alan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks, Alan. It's simpler this way!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Here are some more ways using vectorized function calls:
