We know that MATLAB employs the copy-on-write mechanism for handling arrays. For example
a = zeros(10^6);
b = a;
b = a(123:end);
My question is, can I have something similar to b = a(123:end), but no copy is performed? My vector a is quite large (much larger than 10^6 elements), so slicing causes overhead. Can I create a C MEX-file that assign a pointer of a+123 to b and return the array without copying?