MATLAB: Zero fill xlsread hello i need to make matrix [42X60] from matrix [42×52] how can i make it by filling with zeros? thank u very much! Best Answer You can try something like this:oldMatrix = ones(42,52); % The original matrixnewMatrix = zeros(42,60); % The new matrix (with zeros)newMatrix(1:42, 1:52) = oldMatrix; % Overlap the original matrix in the new matrixHope it helps ;-) ! Related SolutionsMATLAB: Minimum value of a matrix with the main diagonal elements equals to zero out = min(A(A~=0)) MATLAB: How to do a lower triangular with ones along the diagonal Extracting the lower triangle from A and setting the main diagonal to 1:tril(A,-1) + diag(ones(1,size(A,1))Extracting the lower triangle from A and setting the first diagonal of the lower triangle to 1:tril(A,-2) + diag(ones(1,size(A,1)-1),-1) Related QuestionFill structureHow to find the length of segments of a matrix that meet certain conditionCreation of a matrix (24,72) with unit lower triangular matrixFill row of matrixHow to extract rows and leave zeros behindFill comand (functions)
Best Answer