Notifications
Clear all
[Solved] 2-D analogue to Subset( ) ?
Oct 07, 2021 3:25 pm
(@drice)
Member
Joined: 3 years ago
I'm sharing a question a user asked me:
Â
If you have a 1-D array of 1s and 0s (true and false), I know how to use Subset to get a list of the index items where the 1s occur. But what if I have a 2-D array (or more) or 1s and 0s -- is there a way for me to get a list of the coordinates where the 1s occur?
Hadi Eshraghi reacted
Topic Tags
1 Reply
Oct 07, 2021 3:27 pm
(@drice)
Member
Joined: 3 years ago
Here is my solution:
  LocalIndex Ind := IndexesOf(A);
  MdArrayToTable(A)[.Col=Ind]
This is demonstrated in this model. There are other ways of doing it, and if you see another good way, feel free to add it to this thread.Â
Reply
Lonnie Chrisman and Hadi Eshraghi reacted
Forum Jump:
Currently viewing this topic 1 guest.
Forum Information
- 4 Forums
- 87 Topics
- 283 Posts
- 1 Online
- 1,874 Members
Our newest member: xtw18387680a
Forum Icons:
Forum contains no unread posts
Forum contains unread posts
Topic Icons:
Not Replied
Replied
Active
Hot
Sticky
Unapproved
Solved
Private
Closed