I am trying to write a function that takes as its input arguments two scalar positive integers named n and m in that order. The function returns Q, a 2n-by-2m matrix. Q consists of four n-by-m submatrices. The elements of the submatrix in the top left corner are all 0s, the elements of the submatrix at the top right are 1s, the elements in the bottom left are 2s, and the elements in the bottom right are 3s. So far I have a1 = zeros(2,3) a2 = ones(2,3); a3 = 2*ones(2,3) a4= 3*ones(2,3) A = [a1, a2; a3, a4] I don't know how to create a function from what I have.
MATLAB: Function that combines sub matrices into one matrix
matrixsubmatrices
Related Question
- How do i create a (n x n) matrix using algorithm or other way whose elements are either -1, +3, –3 & 1 , otherwise 0, such that a11=a22=a33=…..=-1, a12=a23=a34=…..= 3, a13=a24=a35=…….= -3, a14=a25=a36=….= 1,.
- How to instantly substitute all the Ai_j of a symbolic matrix A
- How could I randomly split the columns of a matrix into 3 matrices with equal number of columns
Best Answer