Calculate the mean of each half of a matrix
Given a matrix with an even number of columns, n, return a 1-by-2 row vector where the first element is the mean of all the elem...
4 years 前
已解决
Matrix Quadrants
Write a function that takes N as the input, and outputs a matrix whose upper-left (NxN) quadrant contains all ones, the lower-ri...
4 years 前
已解决
Find Closest Constant
Given a number x, return the value that is closest to x from this list of constants: 0, 1, , e, , (also known as ).
For exampl...
Find nth maximum
Find nth maximum in a vector of integer numbers. Return NaN if no such number exists.
x = [2 6 4 9 -10 3 1 5 -10];
So
...
4 years 前
已解决
Insert zeros into vector
Insert zeros after each elements in the vector. Number of zeros is specified as the input parameter.
For example:
x = [1 ...
4 years 前
已解决
Generate a vector like 1,2,2,3,3,3,4,4,4,4
Generate a vector like 1,2,2,3,3,3,4,4,4,4
So if n = 3, then return
[1 2 2 3 3 3]
And if n = 5, then return
[1 2 2 3 3 3 4...