已解决


Nearest Numbers
Given a row vector of numbers, find the indices of the two nearest numbers. Examples: [index1 index2] = nearestNumbers([2 5 3...

10 years 前

已解决


Set the array elements whose value is 13 to 0
Input A either an array or a vector (which can be empty) Output B will be the same size as A . All elements of A equal to 13...

10 years 前

已解决


Who is the baby and who is the daddy in this family?
Given an array of numbers that shows the characteristcs of all family members, find who is the baby and who is daddy in this fam...

10 years 前

已解决


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 ...

10 years 前

已解决


Sorting
Assume that x is an n-by-2 matrix. The aim is to return the first column of x, but sorted according to the second column. Exa...

10 years 前

已解决


Lose control
Remove all characters that are below space in ASCII value.

10 years 前

已解决


Count photos
Given n people, everyone must have pictures taken with everyone, each photo includes only two persons, please count the total nu...

10 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...

10 years 前

已解决


Who is the smartest MATLAB programmer?
Who is the smartest MATLAB programmer? Examples: Input x = 'Is it Obama?' Output = 'Me!' Input x = 'Who ?' Ou...

10 years 前

已解决


2 b | ~ 2 b
Given a string input, output true if there are 2 b's in it, false if otherwise Examples: 'Macbeth' -> false 'Publius Cor...

10 years 前

已解决


Replicate elements in vectors
Replicate each element of a row vector (with NaN) a constant number of times. Examples : n=2, A=[1 2 3] -> [1 1 2 2 3 3] n=0...

10 years 前

已解决


Rotate a Matrix
Input a Matrix x, Output y is the matrix rotating x 90 degrees clockwise

10 years 前

已解决


give nth decimal place of pi
max 15th place after the decimal point is ok for now

10 years 前

已解决


Number of 1s in a binary string
Find the number of 1s in the given binary string. Example. If the input string is '1100101', the output is 4. If the input stri...

10 years 前

已解决


Back to basics 23 - Triangular matrix
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, return a matrix with all elements above a...

10 years 前

已解决


Arrange vector in ascending order
Arrange a given vector in ascending order. input = [4 5 1 2 9]; output = [1 2 4 5 9];

10 years 前

已解决


Who knows the last digit of pi?
There is only one man who knows the last digit of pi, who is that man? Give the name of that man, who, by popular believe, can ...

10 years 前

已解决


Rotate a Matrix by 90 degrees
Rotate a Matrix by 90 degrees Example: If the input is: X = 1 2 3 4 5 6 7 8 9 ...

10 years 前

已解决


Determine Whether an array is empty
Input a matrix x, output y is TRUE if x is empty, otherwise FALSE.

10 years 前

已解决


All your base are belong to us
Find the base _b_ logarithm of the input decimal number _x_. Express the output as a decimal number. The first argument is the n...

10 years 前

已解决


Remove DC
Input x is the sampled signal vector, may have both AC and DC components. Output y should not contain any DC component. Examp...

10 years 前

已解决


given 3 sides, find area of this triangle
1:3 -> 0; 3:5 -> 6

10 years 前

已解决


Get the length of a given vector
Given a vector x, the output y should equal the length of x.

10 years 前

已解决


Multiply a column by a row
* Given a column vector C and and a row vector R. * Output a matrix M. * Every column of M equals to C multiplied by correspon...

10 years 前

已解决


Duplicate each element of a vector.
for an n-dimensional vector x, the function should return another vector 2n-dimension which each element is repeated twice. Ex...

10 years 前

已解决


Add two numbers
Calculate the sum of two numbers. Example input = [2 3] output = 5

10 years 前

已解决


pressure to dB?
given x ratio of pressure, find corresponding y dB

10 years 前

已解决


Whether the input is vector?
Given the input x, return 1 if x is vector or else 0.

10 years 前

已解决


So many choices
For inputs _n_ and _k_ (in that order), output the number of ways that k objects can be chosen from amongst n distinct objects. ...

10 years 前

已解决


sum of non-primes
The sum of the non-primes below 10 is 1+4+6+8+9+10=38 Find the sum of all the non-primes below the input, N.

10 years 前

加载更多