Solved


Penny Flipping: Reverse subsets of a sequence of coins until you recover the original configuration
The original Penny Flipping Problem (PF-1) starts with a stack of N pennies arranged with all the coins heads up. The first oper...

14 years ago

Solved


Set a diagonal
Given a matrix M, row vector v of appropriate length, and diagonal index d (where 0 indicates the main diagonal and off-diagonal...

14 years ago

Solved


Gauss Eliminate 2-by-2 example
Use forward elimination to make the coefficient matrix, A, an upper triangular matrix, and then solve using back substitution, f...

14 years ago

Solved


Unique values without using UNIQUE function
You must return unique values in a vector in *stable* mode without using the unique function. About stable order flag: ...

14 years ago

Solved


Find the repeating decimal pattern!
Write a function that takes one double input value and returns only the repeating decimal, if any, as a string. Only decimals f...

14 years ago

Solved


Sum the Infinite Series II
For any x in the range 0 < x and x < 2*pi radians, find the sum of the following infinite series: c = 1 + 1/2*cos(x) + 1/2*3...

14 years ago

Problem


Piecewise linear interpolation
Given an Mx2 vector and a row of M-1 integers, output a two column vector that linearly interpolates Y times between each succes...

14 years ago | 9 | 640 solvers

Solved


Piecewise linear interpolation
Given an Mx2 vector and a row of M-1 integers, output a two column vector that linearly interpolates Y times between each succes...

14 years ago

Solved


Convert Roman to Arabic Numerals
Based upon what I see on tv and at the movies, the use of Roman numerals indicates something is important or sophisticated (e.g....

14 years ago

Solved


Split a string into chunks of specified length
Given a string and a vector of integers, break the string into chunks whose lengths are given by the elements of the vector. Ex...

14 years ago

Solved


We love vectorized solutions. Problem 1 : remove the row average.
Given a 2-d matrix, remove the row average from each row. Your solution MUST be vectorized. The solution will be tested for ac...

14 years ago

Solved


Pi Estimate 2
Estimate Pi as described in the following link: <http://www.people.virginia.edu/~teh1m/cody/Pi_estimation2.pdf>

14 years ago

Solved


Acidity of vinegar and salts
Assuming: pH (potentia hydrogenii) = - log10(H+ ionic concentration in mol/Liter). For a buffer solution containing acetic acid ...

14 years ago

Solved


Matrix which contains the values of an other matrix A at the given locations.
If you have two matrices, which together give xc and yc coordinates into another matrix, eg : xc = [1 1 1; 2 2 1]; ...

14 years ago

Solved


Spiral In
Create an m by n matrix filled with sequential integers starting from 1 and arranged in a counterclockwise spiral that hugs the ...

14 years ago

Solved


Is the Point in a Triangle?
Check whether a point or multiple points is/are in a triangle with three corners Points = [x, y]; Triangle = [x1, y1; x...

14 years ago

Solved


intersection of matrices
Given two matrices filled with ones and zeros, determine if they share a common row, column entry. These matrices are of identi...

14 years ago

Solved


Ordinal numbers
Given an integer n, return the corresponding ordinal number as a character string. For example, ord(1)='1st' ord(2)=...

14 years ago

Solved


Create incremental spiral WITHOUT USING EVAL or FEVAL
Constructions that use feval or eval are used to cheat with cody. This test-suite tries to avoid that trick. The goal of this...

14 years ago

Solved


Cody Matlab Version
What is the current Cody Matlab Release? *Output:* string *Examples:* '(R2012a)' or 'R2012a' Hint: We have mo...

14 years ago

Solved


Pi Estimate 1
Estimate Pi as described in the following link: <http://www.people.virginia.edu/~teh1m/cody/Pi_estimation1.pdf>

14 years ago

Solved


Justify the character string in center with proportional fonts
how to justify a string of character into center with proportional fonts? Example: x='justify string ' output is ' justif...

14 years ago

Solved


Pythagorean perfect squares: find the square of the hypotenuse and the length of the other side
Given the square root of a square number, *seed*, and a range, *n*, find the square number, *Z* as well as the other side, *y*, ...

14 years ago

Solved


Number of bytes required to store a sparse matrix
The input is always a *sparse* matrix : x = sparse(100,1000,0.01); >>whos x shows that 4016 bytes ares required . ...

14 years ago

Solved


swap sign sum & multiply castles
* It is an easy problem, if you know the answer. * Given a square matrix of NxN ordinary numbers. * Initially place N identi...

14 years ago

Solved


Cryptomath: Addition
W A I T + A L L --------- G I F T S equals: 9 6 0 8 + 6 7 7 --------- 1 0 2 8 5 Given str...

14 years ago

Solved


deconvolution
* Suppose there is a vector v like [1 0 0 -1], representing polynomial coefficients. * In this example, the polynimial is 1*x^3...

14 years ago

Solved


"mirror" matrix
Create n x 2n "mirror" matrix of this type: e.g. for n = 2 m = [1 2 2 1;1 2 2 1] e.g. for n = 3 m = [1 2 3 3 2 1...

14 years ago

Solved


Retirement savings
At the start of what year will you have reached or exceeded a savings goal? Parameters (all are constant scalars given in a s...

14 years ago

Solved


Formatting currency numbers
Given a number, format it properly for textual display using the notation $xxx,xxx,xxx.xx. Assume that no more than two digits ...

14 years ago

Load more