Hi All,
I would like to non-circularly shift my matrix and then have zeros padded to either the left or right (depending on the shift) i.e. if the matrix shifts to the right, zeros would be padded to the left.
My code so far looks like this:
%dummy data
data = rand(5, 16);channelSink = 9; %this variable will either be >layerIV, <layerIV or =layerIV
layerIV = 7;chDiff = layerIV - channelSink; for channel = 1:16 if channelSink > layerIV %shift columns to the left by ab(chDiff)
%and
%set columns shifted by ab(chDiff) to zero
elseif channelSink < layerIV %shift columns to the right by chDiff
%and %set columns shifted by chDiff to zero
else %if chDiff = 0, don't shift
chDiff = 0; disp('Sink at channel 7; not necessary to re-align'); end end
Thank you in advance.
Best Answer