已解决


Tricky timing
Write a function that takes between 0.5 seconds and 0.6 seconds to run.

12 years 前

已解决


vectorization in N
For a given integer n (n>1), compute the sum f (i) (1 <= i <= n) where f (i) = 1 if n is odd and 2 otherwise.

12 years 前

已解决


Bottles of beer
Given an input number representing the number of bottles of beer on the wall, output how many are left if you take one down and ...

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

12 years 前

已解决


Elapsed Time
Given two date strings d1 and d2 of the form yyyy/mm/dd HH:MM:SS (assume hours HH is in 24 hour mode), determine how much time, ...

12 years 前

已解决


Better bullseye matrix
<http://www.mathworks.com/matlabcentral/cody/problems/18-bullseye-matrix Problem 18> asks to create a bullseye matrix like this:...

12 years 前

已解决


Balanced number
Given a positive integer find whether it is a balanced number. For a balanced number the sum of first half of digits is equal to...

12 years 前

已解决


Duplicates
Write a function that accepts a cell array of strings and returns another cell array of strings *with only the duplicates* retai...

12 years 前

已解决


Replace NaNs with the number that appears to its left in the row.
Replace NaNs with the number that appears to its left in the row. If there are more than one consecutive NaNs, they should all ...

12 years 前

已解决


Find Rotated Substring
Given a string s1, find if a rotated version of s1 is present in a second string s2. For example, rotated version of some str...

12 years 前

已解决


Factorize THIS, buddy
List the prime factors for the input number, in decreasing order. List each factor only once, even if the factorization includes...

12 years 前

已解决


Return the 'Size' of a String of Code
One of the most 'mysterious' parts of playing Cody is the sizing system. Given a string of commands, return the size that Cody w...

12 years 前

已解决


The Hitchhiker's Guide to MATLAB
Output logical "true" if the input is the answer to life, the universe and everything. Otherwise, output logical "false".

12 years 前

已解决


Pattern matching
Given a matrix, m-by-n, find all the rows that have the same "increase, decrease, or stay same" pattern going across the columns...

12 years 前

已解决


Find the two most distant points
Given a collection of points, return the indices of the rows that contain the two points most distant from one another. The inpu...

12 years 前

已解决


Swap the input arguments
Write a two-input, two-output function that swaps its two input arguments. For example: [q,r] = swap(5,10) returns q = ...

12 years 前

已解决


Implement a ROT13 cipher
Replace each character in string s1 with the character that is shifted 13 positions from it (wrap back to the beginning if neces...

12 years 前

已解决


Find the numeric mean of the prime numbers in a matrix.
There will always be at least one prime in the matrix. Example: Input in = [ 8 3 5 9 ] Output out is 4...

12 years 前

已解决


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

12 years 前

已解决


Project Euler: Problem 1, Multiples of 3 and 5
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23...

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

12 years 前

已解决


All capital?
Are all the letters in the input string capital letters? Examples: 'MNOP' -> 1 'MN0P' -> 0

12 years 前

已解决


Roll the Dice!
*Description* Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. *Example* [x1,x2] =...

12 years 前

已解决


Remove NaN ?
input -> matrix (n*m) with at least one element equal to NaN; output -> matrix(p*m), the same matrix where we deleted the enti...

12 years 前

已解决


Which values occur exactly three times?
Return a list of all values (sorted smallest to largest) that appear exactly three times in the input vector x. So if x = [1 2...

12 years 前

已解决


Is my wife right? Now with even more wrong husband
Again, as in "Is my wife right?" ( <http://www.mathworks.com/matlabcentral/cody/problems/149-is-my-wife-right> ), answer 'yes' r...

12 years 前

已解决


Counting Sequence
Given a vector x, find the "counting sequence" y. A counting sequence is formed by "counting" the entries in a given sequence...

12 years 前

已解决


Find the sum of the elements in the "second" diagonal
Find the sum of the elements in the diagonal that starts at the top-right corner and ends at the bottom-left corner.

12 years 前

已解决


Reverse Run-Length Encoder
Given a "counting sequence" vector x, construct the original sequence y. A counting sequence is formed by "counting" the entrie...

12 years 前

已解决


Biggest Value in the (Neighbor)Hood
For this challenge you get two inputs: a matrix A and an integer value n. Your function should return a Matrix B of the same si...

12 years 前

加载更多