Solved


Number of digits in an integer
Specifies how many digits in a given integer. Example: in=100 ==> out=3

12 years ago

Solved


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

12 years ago

Solved


Recurring Cycle Length (Inspired by Project Euler Problem 26)
Preface: This problem is inspired by <http://projecteuler.net/problem=26 Project Euler Problem 26> and uses text from that quest...

12 years ago

Solved


Two-output anonymous function?
Return a function handle that when applied to an input, it produces two outputs: the first is the same as the input, and the sec...

12 years ago

Solved


Number of vertices of a hypercube
Return the number of vertices of a n-dimensional hypercube.

12 years ago

Solved


Perl 1: push
_This is part of a series of perl function which were very helpful for many perl programmers. Could you implement it in Matlab?_...

12 years ago

Solved


Sort complex numbers into complex conjugate pairs
Sort complex numbers into complex conjugate pairs. Example: Input x = [3-6i -1-4i -1+4i 3+6i] Sorted output = [-1 - ...

12 years ago

Solved


Try 1.5.4: Celsius to Fahrenheit
Write a program to convert an input given in Celsius to Fahrenheit. Examples: Input celsiusValue = 100 Output fahrValu...

12 years ago

Solved


Mirror Image matrix across anti-diagonal
Given an input number x, create a Mirror Image matrix 'Y' across anti-diagonal in following way:- Example:- If x=3, Y= [1 ...

12 years ago

Solved


Rescaling vector
Rescale the entries of a vector x so that it spams [a,b]. The new values should be linearly stretched into the new range. _Ex...

12 years ago

Solved


Eliminate unnecessary polygon vertices
Suppose you have an n-point polygon represented as an n-by-2 matrix of polygon vertices, P. Assume that the polygon is closed; t...

12 years ago

Solved


Decimal Comparison
*Background* A utility of particular interest to Cody and other MATLAB ventures is comparing the equality of two numbers. In ...

12 years ago

Solved


Without french accent please !
Suppress french accent For example 'Déjà présent' -> 'Deja present'

12 years ago

Solved


Prime Time
All you need to do here is submit your solution a prime number of seconds after the top of the hour. Any hour at all... Easy, ...

12 years ago

Solved


Calculate the probability that at least two people in a group share the same birthday.
Calculate the probability that at least two people in a group share the same birthday. Given an integer input n, return to 0.015...

12 years ago

Solved


Surface Fit z(x,y)
Given three vectors x,y,z. Find four coefficients c = [cxx cxy cyy c00], such that z = cxx*x.^2+cxy*x.*y+cyy*y.^2+c00. For e...

12 years ago

Solved


Linear system solve
Solve a linear set of equations as described in the following link: http://www.people.virginia.edu/~teh1m/cody/linsolv1.pdf

12 years ago

Solved


Identify the heavier bag
There are N=2^n bags of rice looking alike, N-1 of which have equal weight and one is slightly heavier. The weighing balance is ...

12 years ago

Solved


matrix zigzag
Unfold a 2-D matrix to a 1-D array in zig-zag order, e.g., for matrix [ 1 2 3 ; 4 5 6 ; 7 8 9 ] the resulting 1-...

12 years ago

Solved


Solve Quadratic : No * - or key functions permitted
Solve the quadratic equation *ax^2+bx+c=0*. However, some of the normal functions and symbols are not allowed. x=[ -b +/- sq...

12 years ago

Solved


Possible Outcomes of American Roulette
The payout for American roulette can be calculated by: payout = (38/n)-1 where n is the number of squares the bet covers. ...

12 years ago

Solved


Non-zero bits in 10^n.
Given an integer that is a power of 10, find the number of non-zero bits, k, in its binary representation. For example: * ...

12 years ago

Solved


Removing rows from a matrix is easy - but what about inserting rows?
Assume A is a 5-by-5 matrix. A([2,4],:) = [] is a quick way to remove rows 2 and 4. Can you find a quick way to insert rows into...

12 years ago

Solved


Gambler?
Given a handle to a wealth function, confirm within 100 milliseconds 'Millionaire', 'Likely', or 'Gambler', if wealth() returns ...

12 years ago

Solved


Great Circle Distance
Find shortest between two points on a ball given their azimuthal and polar angles (in degrees) as well as the radius of the sphe...

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

12 years ago

Solved


mathematics , probability problem
How many different result can we have, rolling k dice?

12 years ago

Solved


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

12 years ago

Solved


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

12 years ago

Solved


The Birthday Phenomenon
First off, leap years are not being considered for this. In fact the year that people are born shouldn't be taken into considera...

12 years ago

Load more