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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

selection of items in a Marix

ptc-5031132
1-Newbie

selection of items in a Marix

Hello everybody,

I need some help to select sevral lign in a matrix using a logical test and then create a vector which wwould summarize all selected items.

To be more accurate, my problem is to select the right "spring" cosidering given deflexion and maximum reaction load within this loading configuration. I already creat a fonction which calculat the reaction load for a given deflexion and spring model ( equ_paulstra_reactionload("matrix of the approximated polynomial coeficient which give reaction load in function of the deflexion","deflexion","ligne of the considered model" ). Then I would create a fonction which test each spring and put them in a vector using there reference.

I join my work done so far.

Thanks a lot for your elp,

regards,

Mathieu STAUCH

1 ACCEPTED SOLUTION

Accepted Solutions
MikeArmstrong
5-Regular Member
(To:ptc-5031132)

Have a look if the attached is of any help.

I have added units to max_spring_reaction - you might want to change them

Mike

View solution in original post

10 REPLIES 10
MikeArmstrong
5-Regular Member
(To:ptc-5031132)

You haven't defined Reaction_Spring.

Mike

My mistake,

Reaction_Spring is defined at the beginnig as max_spring_reaction. (I modified it but Im not able to send it on my response, sorry)

Mat

MikeArmstrong
5-Regular Member
(To:ptc-5031132)

Have a look if the attached is of any help.

I have added units to max_spring_reaction - you might want to change them

Mike

Thak you very much!

one last think, could it be possible to simply remove all zero from that vector and then obtain a clear vector which summarize the possible spring?

Thanks a lot one more time,

Mat

Would the attached file help?

Only values which pass the condition are collected in the output vector. With your test data there is no difference seen as all values pass.

MikeArmstrong
5-Regular Member
(To:ptc-5031132)

As Werner has shown, just remove the zero otherwise statement.

Mike

Mike Armstrong wrote:

As Werner has shown, just remove the zero otherwise statement.

Mike

Just removing the otherwise statement would still put the zeros in the resulting vector.

MikeArmstrong
5-Regular Member
(To:Werner_E)

Oh, you also snuck the rows(P) feature in. I must pay more attention

Mike

cleaned up two programming errors.

Nothing attached Fred.

Mike

Top Tags