MATLAB: How generating evenly spaced vectors with overlap arrayMATLAB Hi all, I need to generate evenly spaced vectors with overlap. How can I do it? Here an example: Input: [0 5 10 15 20]; Output: [0 5, 4 10,9,15,20]; I know they are not even, but also like that is fine. Thanks cheers Best Answer Starting with the linspace above that people suggested you can get the over lap you by doing this:input = [0 5 10 15 20];overlap = 5; % percentoverlap = input(end)*(overlap/100);output = [input(1:end-1)'-overlap input(2:end)']output(output<0) = 0;disp(output) Related SolutionsMATLAB: From a given vector create all combinations possible >> V = [5,10,15];>> [X,Y] = ndgrid(V);>> M = [Y(:),X(:)]M = 5 5 5 10 5 15 10 5 10 10 10 15 15 5 15 10 15 15 MATLAB: Remove index x = [10 2 3 5 15 7 8 100 2 10 12 23 20]; x(3:3:end) = []; Related QuestionNeed help creating a for loopHow to include row pitch yawSkill with regexprepMoving a Polygon on a PolygonHow interpolate 3d points
Best Answer