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

Setting and array equal to elements of another

fredericksonnic
1-Newbie

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

1 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
Check out the latest
Mathcad Tip
"PTC Mathcad 15 / Prime 1-6 Update."