make an eye matrix which element is 1:n
for a given input n, make an n by n matrix which contains elements 1:n
for example
input =5
output = [1 0 0 0 0;0 2 0 0 0; 0...
9 years ago
Solved
Change input vector
If a input vector is [3, 2, 6, 1, 6], the output vector is [3, 2, 6, 1, 6] + [1, 2, 3, 4, 5] = [4, 4, 9, 5, 11].
9 years ago
Solved
true or false
if the matrix has a zero, return true. else, return false
9 years ago
Solved
Replace all odd numbers with NaN
Replace all odd numbers in the vector or matrix with NaN. For example, if
x = [1 3 4 5 8 11];
then return
y = [NaN Na...