To create a matrix that is 5x5, with the first three columns being an identity matrix (eye(3)), and the fourth and fifth columns both containing the value 2, you can use the following code in MATLAB:
main.m208 chars12 lines
This will give you the following matrix:
main.m130 chars6 lines
To make the last two rows of the matrix contain the value 3, you can modify the code as follows:
main.m261 chars15 lines
This will give you the following matrix:
main.m130 chars6 lines
gistlibby LogSnag