I wrote
array = linspace(0, 1);
sliceSize = 10;
sliceBegin = 1 + length(array) - sliceSize;
slice = array(sliceBegin: length(array));
that's too verbose. How to make it shorter?
a = rand(100,1); %# vector
a(end-5+1:end) %# last five elements
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With