A résolu


Procrustean bed
Given a vector x and an integer n, convert x to a vector of length n by (1) chopping off the end if it is too long, or (2) addin...

environ 13 ans il y a

A résolu


Number of cyles and fixed points in a permutation
A permutation can be constructed from one or more sets of elements in cyclic order. A permutation in a single row vector form ...

environ 13 ans il y a

A résolu


Related Vectors
I have two vectors A & B. If the values in vector A is zero then the corresponding value in vector B should be zero. Example:...

environ 13 ans il y a

A résolu


Clock Solitaire
Many card players will be familiar with the game of <http://en.wikipedia.org/wiki/Clock_patience Clock Solitaire>. Briefly, th...

environ 13 ans il y a

A résolu


Chebyshev polynomials of the 2nd Kind
Given an integer _n_ &ge; 0, generate the _n_-th <http://en.wikipedia.org/wiki/Chebyshev_polynomials Chebyshev polynomial of the...

environ 13 ans il y a

A résolu


Chebyshev polynomials of the 1st Kind
Given an integer _n_ &ge; 0, generate the _n_-th <http://en.wikipedia.org/wiki/Chebyshev_polynomials Chebyshev polynomial of the...

environ 13 ans il y a

A résolu


Mode
Find the mode of the vector Assumption: no vector is bimodal Example 1: input=[1 2 3 4 4]; output=4 Example 2: input=[7...

environ 13 ans il y a

A résolu


Champernowne Constant
The <http://en.wikipedia.org/wiki/Champernowne_constant Champernowne constant> is a real number whose digits in decimal represen...

environ 13 ans il y a

A résolu


Hungry Snake
Who hasn't played <http://en.wikipedia.org/wiki/Snake_%28video_game%29 the Snake game> when they were little? It's quite hard ...

environ 13 ans il y a

A résolu


Number of paths on a grid
Consider a grid formed by n vertices vertically down, and m vertices horizontally right. Your starting point is at the top lef...

environ 13 ans il y a

A résolu


Method of Common Differences part-1
Use the method of common differences to output a vector containing the initial values and the nth order difference. ex ...

environ 13 ans il y a

A résolu


Method of Common Differences part-2
This is the inverse problem to <http://www.mathworks.com/matlabcentral/cody/problems/1485 Problem 1485>. Problem 1485 illustra...

environ 13 ans il y a

A résolu


Hamiltonian Cycle
This is related to the Travelling Salesman Problem <http://www.mathworks.com/matlabcentral/cody/problems/1339 1339> created by...

environ 13 ans il y a

A résolu


Index of a Rational number
The set of real numbers are infinite. They are so many that real numbers can't even be enumerated. However, unlike real numbers ...

environ 13 ans il y a

A résolu


nth Rational Number
Return the nth rational number. This is the inverse to Problem <http://www.mathworks.com/matlabcentral/cody/problems/1471 1...

environ 13 ans il y a

A résolu


Symmetry of vector
Determine whether the vector is symmetric or not (vector could be even or odd in length). For example: x = [1 2 3 3 2 1] ...

environ 13 ans il y a

A résolu


Minimum Distance between two N-sided Polygons
This Challenge is to determine the minimum distance between two non-overlapping polygons. The input is a cell array of two vecto...

environ 13 ans il y a

A résolu


Create Volcano (or Atoll) martix. It is an extension of Bullseye matrix problem.
For example, if n=2 (maximum value), the output matrix should be [1 1 1 1 1; 1 2 2 2 1; 1 2 1 2 1; 1 2 2 2 1; 1...

environ 13 ans il y a

A résolu


Edges of a n-dimensional Hypercube
Return the number of edges on an <http://en.wikipedia.org/wiki/Hypercube _n_-dimensional hypercube> (with an integer n &ge; 0). ...

environ 13 ans il y a

A résolu


Minimum Distance Point to Segment
This Challenge is to determine the minimum distance from a 2-D line segment defined by two points to a point. The point is (p...

environ 13 ans il y a

A résolu


Volume of a Simplex
Return the volume of a <http://en.wikipedia.org/wiki/Simplex regular _n_-simplex> with a unit side length. Results are up to...

environ 13 ans il y a

A résolu


Calculate compression ratio of engine
Calculate compression ratio of engine given compression volume of cylinder(Vc), piston stroke(s) and valve diameter(d)

environ 13 ans il y a

A résolu


Implement full adder circuit
Implement full adder circuit as given in <http://en.wikipedia.org/wiki/Adder_(electronics)> Inputs signals are a, b and ...

environ 13 ans il y a

A résolu


Find the optimal shape to bring the maximum product by a given perimeter
Find the optimal shape (with N sides) to bring the maximum product of the sides length, by a given perimeter. Example: Assumin...

environ 13 ans il y a

A résolu


sinus function
x is the abscissa. find the absolute value of cosine of -x and the same value with changed sign.

environ 13 ans il y a

A résolu


Remove entire row and column in the matrix containing the input values
Remove the entire row and column from the matrix containing specific values. The specified value can be a scalar or a vector. Fo...

environ 13 ans il y a

A résolu


subtract central cross
Given an n-by-n square matrix, where n is an odd number, return the matrix without the central row and the central column.

environ 13 ans il y a

A résolu


frame of the matrix
Given the matrix M, return M without the external frame.

environ 13 ans il y a

A résolu


Number of lattice points within a circle
Find the number of points (x,y) in square lattice with x^2 + y^2 =< n. This is related to Jame's <http://www.mathworks.com/matla...

environ 13 ans il y a

A résolu


Continued fractions
Find a <http://en.wikipedia.org/wiki/Continued_fraction continued fraction> approximation of x.

environ 13 ans il y a

Charger plus