Is there any easy way to concatenate matrices with unequal dimensions using zero padding?
short = [1 2 3]\'; long = [4 5 6 7]\'; desiredResult = horzcat(shor
Matlab automatically does padding when writing to a non-existent element of a matrix. Therefore, another very simple way of doing this is the following:
short=[1;2;3]; long=[4;5;6;7]; short(1:length(long),2)=long;
short=[1;2;3];
long=[4;5;6;7];
short(1:length(long),2)=long;