function [sec] = getSection(inp,a,b) [m,n] = size(inp); ste = (m-1)/b; st=1+ceil(ste*(a-1)); ed=1+floor(ste*a); sec = inp(st:ed,:); end