A résolu


Generate a NaN...on purpose
The goal is to create a function that will return a single "NaN" without using the nan function. I am interested to see how many...

environ 11 ans il y a

A résolu


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

environ 11 ans il y a

A résolu


Back to basics 18 - justification
Covering some basic topics I haven't seen elsewhere on Cody. Given a string with extra spaces in front and/or in back, return...

environ 11 ans il y a

A résolu


Create a vector whose elements depend on the previous element
The idea is to create a vector A whose elements depend on the previous element : *A(i+1) = 2*A(i)+1* *2 Inputs*: - A : The...

environ 11 ans il y a

A résolu


Steal, Share, or Catch: Tournament of Champions
I am no longer supporting this problem. No changes will be made to put more entries in the test suite, but have fun playing any...

environ 11 ans il y a

A résolu


Steal, Share, or Catch
You, I, and a few other characters are going to play a game of *Steal, Share or Catch*. We are going to play it 10,000 times vs...

environ 11 ans il y a

A résolu


Replace multiples of 5 with NaN
It is required to replace all values in a vector that are multiples of 5 with NaN. Example: input: x = [1 2 5 12 10 7] ...

environ 11 ans il y a

A résolu


Construct a string from letters and counts
Given two input arrays like this: [5,3,1] ['a','b','c'] Output a string that contains each letter the specified num...

environ 11 ans il y a

A résolu


N-Cards Problem
You have a deck of _N_ cards numbered in order from 1 to _N_. You discard the top card (card 1) and place the next card (card 2)...

environ 11 ans il y a

A résolu


surrounded matrix
With a given matrix A (size m x n) create a matrix B (size m+2 x n+2) so that the matrix A is surrounded by ones: A = [1 2 ...

environ 11 ans il y a

A résolu


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.

environ 11 ans il y a

A résolu


Back to basics 19 - character types
Covering some basic topics I haven't seen elsewhere on Cody. Return the number of punctuation characters in the input variabl...

environ 11 ans il y a

A résolu


Return unique values without sorting
If the input vector A is [42 1 1], the output value B must be the unique values [42 1] The *values of B are in the s...

environ 11 ans il y a

A résolu


Is this matrix orthogonal?
Given a square matrix, a, determine whether it is orthogonal. INPUT: a, a n x n matrix OUTPUT: true or false

environ 11 ans il y a

A résolu


Back to basics 13 - Input variables
Covering some basic topics I haven't seen elsewhere on Cody. Return as a string the name of the input variable to the functio...

environ 11 ans il y a

A résolu


Back to basics 5 - Clipboard
Covering some basic topics I haven't seen elsewhere on Cody. Copy the input string to the clipboard

environ 11 ans il y a

A résolu


Back to basics 17 - white space
Covering some basic topics I haven't seen elsewhere on Cody. Remove the trailing white spaces from the input variable

environ 11 ans il y a

A résolu


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

environ 11 ans il y a

A résolu


Knights and Knaves (part 3)
_This is a Matlab adaptation of the_ <http://en.wikipedia.org/wiki/Knights_and_Knaves Knives and Knaves> _logical puzzles_. ...

environ 11 ans il y a

A résolu


Knights and Knaves (part 2)
_This is a Matlab adaptation of the_ <http://en.wikipedia.org/wiki/Knights_and_Knaves Knives and Knaves> _logical puzzles_. ...

environ 11 ans il y a

A résolu


Knights and Knaves (part 1)
This is a Matlab adaptation of the <http://en.wikipedia.org/wiki/Knights_and_Knaves Knights and Knaves> logical puzzles. You ...

environ 11 ans il y a

A résolu


the fly, the train, the second train, and their Zeno's paradox
*You have heard this one*: A train leaves station _A_ and travels with constant velocity _v1_. A second train leaves station _B_...

environ 11 ans il y a

A résolu


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

environ 11 ans il y a

A résolu


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

environ 11 ans il y a

A résolu


Reverse Boggle
*Description* In the classic Parker Brothers game <http://en.wikipedia.org/wiki/Boggle Boggle>, players find words from a 4x4...

environ 11 ans il y a

A résolu


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

environ 11 ans il y a

A résolu


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

environ 11 ans il y a

A résolu


N-Queens Checker
Picture a chessboard populated with a number of queens (i.e. pieces that can move like a queen in chess). The board is a matrix,...

environ 11 ans il y a

A résolu


Wilf-Zeilberger pairs
Take as inputs two functions _F_ and _G_, and two scalar values _n_ and _k_. Test whether the functions are candidates to be a W...

environ 11 ans il y a

A résolu


Derivative of polynomial
Compute the derivative of a given polynomial. The input is an <http://www.mathworks.com/help/matlab/math/representing-polynomial...

environ 11 ans il y a

Charger plus