cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Extracting values in a matrix

LUBR
4-Participant

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. 

Capture.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
LucMeekes
23-Emerald III
(To:LUBR)

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

View solution in original post

7 REPLIES 7
MartinHanak
24-Ruby II
(To:LUBR)
LUBR
4-Participant
(To:MartinHanak)

Hi.

Thank you, but I think I wasn't very clear. This is what I am trying to do:

Capture.PNG

LucMeekes
23-Emerald III
(To:LUBR)

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

LUBR
4-Participant
(To:LucMeekes)

Thanks a lot, Luc!

It worked!

Capture_1.PNG

AlanStevens
17-Peridot
(To:LUBR)

You can use the logic operators as follows:

 

select.PNG

 

 

 

Alan

LUBR
4-Participant
(To:AlanStevens)

Thanks, Alan. It's simpler this way!

Werner_E
24-Ruby V
(To:LUBR)

Here are some more ways using vectorized function calls:

B.PNG

Top Tags