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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Setting and array equal to elements of another

fredericksonnic
1-Visitor

Setting and array equal to elements of another

I want to take select elements of one array and use them to initiaize another I am subsampling an array. For example:

i = 0;10

A=i

B=[1,3,6]

Now I want:

C[0] = A[1]

C[1] = A[3]

C[2] = A[6]

Of course for my real case the arrays are very large.

Is there a simple way to do this similar to matlab, using arry B to index into A? At this point I have to use a program but I expect there is a nice way to do this with something like C= A[B

Thanks

Fritz

ACCEPTED SOLUTION

Accepted Solutions

You're very close. ORIGIN in mathcad defaults to 0

View solution in original post

2 REPLIES 2

You're very close. ORIGIN in mathcad defaults to 0

Thank you Fred. I had a syntax error in my "subscripts of subcripts" and your example helped me to figure it out.

Cheers!

Fritz

Announcements

Top Tags