Given two odd numbers, [m, n], return a matrix of size m x n which has all elements of the centre column and centre row set as 1, and all other elements in the matrix set as 0.
Given two even numbers, [p, q], return a matrix of size p x q which has the centre band of two numbers set as 1. However, there must be at least four zeros on the outer corners of the matrix.
For example, [m, n] = [3, 3] would return:
[0,1,0; 1,1,1; 0,1,0];
And for even numbers: [p, q] = [4, 3] would return
[0,1,0; 1,1,1; 1,1,1; 0,1,0];
It seems to me that the result for [m,n]=[4,4] is incorrect.
Program an exclusive OR operation with logical operators
597 Solvers
Find last non-zero in a given dimension
26 Solvers
Back to basics 11 - Max Integer
611 Solvers
60 Solvers
88 Solvers