解決済み


Indexed Probability Table
This question was inspired by a Stack Overflow question forwarded to me by Matt Simoneau. Given a vector x, make an indexed pro...

14年弱 前

解決済み


surface of a spherical planet
you just discovered its circumference, that is the input.

14年弱 前

解決済み


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

14年弱 前

解決済み


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

14年弱 前

解決済み


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

14年弱 前

解決済み


Sorted highest to lowest?
Return 1 if the input is sorted from highest to lowest, 0 if not. Example: 1:7 -> 0 [7 5 2] -> 1

14年弱 前

解決済み


Too mean-spirited
Find the mean of each consecutive pair of numbers in the input row vector. For example, x=[1 2 3] ----> y = [1.5 2.5] x=[1...

14年弱 前

解決済み


inner product of two vectors
inner product of two vectors

14年弱 前

解決済み


Project Euler: Problem 3, Largest prime factor
The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number being input, input might be ui...

約14年 前

解決済み


Project Euler: Problem 2, Sum of even Fibonacci
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 te...

約14年 前

解決済み


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

約14年 前

解決済み


Proper Factors
Generate the proper factors of input integer _x_ and return them in ascending order. For more information on proper factors, ref...

約14年 前

解決済み


Mimic foldl in functional programming
Mimic the higher-order function |foldl| ( <http://en.wikipedia.org/wiki/Fold_%28higher-order_function%29 Wikipedia:Fold (higher-...

約14年 前

解決済み


Create a dictionary
The goal is to write a function that returns a dictionary from a list of words or phrases and their definitions. Here is an exam...

約14年 前

解決済み


Filter values in a vector
Cody often benefits from a functional style of programming. For example, your score is often better when you compose multiple fu...

約14年 前

解決済み


Data decompression
A chunk of data is to be 'decompressed'. Input: * compressed: a row vector of uint8 values. This is the compressed data. ...

約14年 前

解決済み


Is this date a palindrome?emordnilap a etad siht sI
Take a MATLAB date number as input, and return true if the date is a palindrome, false if the date is not a palindrome. A date ...

約14年 前

解決済み


Smallest distance between a point and a rectangle
Given two points *x* and *y* placed at opposite corners of a rectangle, find the minimal euclidean distance between another poin...

約14年 前

解決済み


Pizza!
Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.] Non-scor...

約14年 前

解決済み


yet another flying fly (YAFF)
Same as the previous problem <http://www.mathworks.com/matlabcentral/cody/problems/203-fly-fly-away fly fly away> but now with *...

約14年 前

解決済み


fly fly away
A fly moves following a predefined sequence of discrete jumps (defined by the vectors _dx_ and _dy_) repeating the same sequence...

約14年 前

解決済み


hackathon impossible
You might have found a solution to our <http://www.mathworks.com/matlabcentral/cody/problems/205-hackathon-the-beginnings previo...

約14年 前

解決済み


the return of the hackathon
You might have found a solution to our <http://www.mathworks.com/matlabcentral/cody/problems/205-hackathon-the-beginnings previo...

約14年 前

解決済み


Hackathon: the beginnings
I am thinking of a number between 1 and 10000... can you guess what this number is? *Description* The test suite has rando...

約14年 前

解決済み


Pull the variable y_correct from the Caller's Workspace
*Description* This highlights a very easy to use and high-scoring cheat that can be used on almost all Cody questions.

約14年 前

解決済み


hanoi towers II
with 3 rods (1,2 & 3), the goal is to move a tower of n disks from rod #1 to rod #3. You can move disks only one by one, on the...

約14年 前

解決済み


does it touch ?
given a sentence, tell how much it touches. input : string output : how much it touches touching : a bilabial phoneme d...

約14年 前

解決済み


love is an n-letter word
Given a list of *N words*, return the *N-letter word* (choosing one letter from each word) with the property of having the least...

約14年 前

解決済み


Read a Soroban Abacus
*Description* The Soroban is the name of the modern Japanese abacus. Information on reading a Soroban can be found <http://we...

約14年 前

解決済み


Kaprekar numbers
Test if the input is a Kaprekar number: <http://mathworld.wolfram.com/KaprekarNumber.html>. Return a logical true or false. ...

約14年 前

さらに読み込む