I know in Mathematica, I can do
A = Range[100];
B = A[[50 ;; 60]]
B will then contain the 50th through 60th elements of A.
Now, what if I wanted B to take 10th through 40th plus 60th through 80th. Can I do so in one expression such as
B = A[[10 ;; 40 + 60 ;; 80]]
Apparently the above code doesn't work. But I don't want to generate a separate list to do so. Is there a short-cut or elegant way of combining two or more spans in one Part expression?
I hope ;; is treated as range. Also, typeing Part, i.e., [[]], really takes a lot of time to type. I wish Mathematica 10 will shorten it to < > or ( ).
{0}inExtract[lis, {{0}, ...? – a06e Sep 22 '15 at 14:30{}in place of{0}. Also note that this will not work in version 10+. – RunnyKine Sep 22 '15 at 15:51