No products are associated with this question.
It depends. As said already you can crop the longer ones, pad the shorter ones or apply an interpolation. For the latter there are linear, cubic, spline, bsline, trigonometric and more complicated interpolation methods.
S1 = size(FirstMatrix); S2 = size(SecondMatrix); MaxS = max(S1, S2);
if MaxS(1) > S1(1); FirstMatrix(end+1:MaxS(1), :) = 0; end if MaxS(2) > S1(2); FirstMatrix(:, end+1:MaxS(2)) = 0; end
if MaxS(1) > S2(1); SecondMatrix(end+1:MaxS(1), :) = 0; end if MaxS(2) > S2(2); SecondMatrix(:, end+1:MaxS(2)) = 0; end
You can simplify this a bit if you are using vectors and you know the orientation of the vectors.
Can you provide the data? you can do it by adding zeros, ones, any desirable data to the data having minimum sizes from data having maximum sizes by initializing max. data length caustiously..
Play games and win prizes!Learn more