Some Assembly Required
The input to this function is a matrix of real numbers. Your job is to assemble the rows of the matrix into one large row that ...
Set some matrix elements to zero
First get the maximum of each *row*, and afterwards set all the other elements to zero. For example, this matrix:
1 2 3 ...
Matrix with different incremental runs
Given a vector of positive integers
a = [ 3 2 4 ];
create the matrix where the *i* th column contains the vector *1:a(i)...
約2年 前
解決済み
surrounded matrix
With a given matrix A (size m x n) create a matrix B (size m+2 x n+2) so that the matrix A is surrounded by ones:
A = [1 2 ...
約2年 前
解決済み
Flip the main diagonal of a matrix
Given a n x n matrix, M, flip its main diagonal.
Example:
>> M=magic(5);
>> flipDiagonal(M)
9 24 1 ...