已解决


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 前

已解决


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 前

已解决


Magic!
Check whether the input matrix is a normal magic square: <http://en.wikipedia.org/wiki/Magic_square> Output the logical va...

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 前

已解决


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

10 years 前

已解决


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

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 前

已解决


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 前

已解决


Number of 1s in the Binary Representation of a Number
*Description* Return the number of 1s in the (unsigned integer) binary representation of a number. This function should be ab...

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 前

已解决


Number of Horns on a unicorn!
Calculate the number of horns on a *unicorn*! And I'm talking about a unicorn with not more than one horn on it!

10 years 前

已解决


Convert a vector into a number
This is a sub problem related to this problem: <http://www.mathworks.com/matlabcentral/cody/problems/621-cryptomath-addition>...

10 years 前

已解决


Back to basics 1 - Saving
Covering some basic topics I haven't seen elsewhere on Cody. Given an input variable 'x', save it to disk in a file named 'co...

10 years 前

已解决


Compute a dot product of two vectors x and y
x and y are input vectors, d is a number and contains their dot product

10 years 前

已解决


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

10 years 前

已解决


Back to basics 12 - Input Arguments
Covering some basic topics I haven't seen elsewhere on Cody. Return a value equal to the number of input arguments to the fun...

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 前

已解决


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 前

已解决


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

10 years 前

已解决


Love triangles
Given a vector of lengths [a b c], determines whether a triangle with non-zero area (in two-dimensional Euclidean space, smarty!...

10 years 前

已解决


Increment a number, given its digits
Take as input an array of digits (e.g. x = [1 2 3]) and output an array of digits that is that number "incremented" properly, (i...

10 years 前

已解决


Back to basics 22 - Rotate a matrix
Covering some basic topics I haven't seen elsewhere on Cody. Rotate the input matrix 90 degrees counterclockwise (e.g. [1 2; ...

10 years 前

已解决


First N Perfect Squares
*Description* Return the first N perfect squares *Example* input = 4; output = [ 1 4 9 16 ];

10 years 前

已解决


Pizza value using expression with parentheses
Pizza prices are typically listed by diameter, rather than the more relevant feature of area. Compute a pizza's value (cost per ...

10 years 前

已解决


Back to basics 8 - Matrix Diagonals
Covering some basic topics I haven't seen elsewhere on Cody. Given an input vector of numbers, output a square array with the...

10 years 前

已解决


Omit columns averages from a matrix
Omit columns averages from a matrix. For example: A = 16 2 3 13 5 11 10 8 9 7 ...

10 years 前

已解决


Program an exclusive OR operation with logical operators
Program an exclusive or operation *without* using the MATLAB function xor. Use logical operators like |, &, ~, ... instead. ...

10 years 前

已解决


Return the first and last character of a string
Return the first and last character of a string, concatenated together. If there is only one character in the string, the functi...

10 years 前

已解决


Given an unsigned integer x, find the largest y by rearranging the bits in x
Given an unsigned integer x, find the largest y by rearranging the bits in x. Example: Input x = 10 Output y is 12 ...

10 years 前

加载更多