Solved


MATLAB Prison: Summing light bulbs
On one wall in the MATLAB prison there is a row of n numbered light bulbs. Each bulb is controlled by a switch. Every morning, n...

10 years ago

Solved


Full combinations
Given n input vectors x1, x2, …, xn, generate a p*n matrix y whose rows contain all element-wise combinations of the vectors x1,...

10 years ago

Solved


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

10 years ago

Solved


Mr. Pyramidad & Ms. Whissy Bolower
Businessman Mr. B. M. Pyramidad was drinking with his new girlfriend Ms. Whissy Bolower. He disclosed to her that he has an ille...

10 years ago

Solved


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

10 years ago

Solved


Spherical radius given four points
Determine the radius of a sphere provided four non-coplanar points on the surface of the sphere. pts = [x1 y1 z1; x...

10 years ago

Solved


Make a function that returns its own character count
Write a function that returns a 128 element vector with an accurate inventory of the ASCII characters in its own function file. ...

10 years ago

Solved


That's some divisor you've got there...
Given a positive integer x, calculate the sum of all of the divisors of the number. Please include the number itself in your fi...

10 years ago

Solved


Breaking Bad Tiles (Spelling with Element Symbols)
Given a word, how you would spell it with element symbols from the periodic table? For instance, if given the string "Paper", yo...

10 years ago

Solved


Number of divisors of a given number
Given a Number n, return the number of his divisors without listing them example: n=14 ; Divisors={1,7,2,14} ; y=4 n=...

10 years ago

Solved


Is It a Snake?
Given an m-by-n matrix, return true if the elements of the matrix are a connected "snake" shape from 1 to m*n. Otherwise return ...

10 years ago

Solved


How many ways to write a number
Given two positive numbers n and k, where n>=k. In how many ways can we write n as sum of k positive numbers. Same numbers but d...

10 years ago

Solved


Regular polygon bounded by and bounding a circle
As the number of sides (or vertices) of a regular polygon goes to infinity, its perimeter and area go to the perimeter and area ...

10 years ago

Solved


Rearrange string
Input is a given string. Output is the number of ways to rearrange the string.

10 years ago

Solved


Choose group with people
How many ways can you choose n groups of n people from n^2 people, assuming the groups are distinct? The number of people i...

10 years ago

Solved


Regex match
Many regular expression engines have a simple function to quickly know whether a regular expression entirely matches a string or...

10 years ago

Solved


Two fractions, one sum
Given a positive number x, write a MATLAB script that will tell you how many ways that the reciprocal of that number can be writ...

10 years ago

Solved


Accessing values in a cell
You are given c, which is a 1xN cell array, and a and b, which are each two 1xM vectors. Your job is to give the bth value in t...

10 years ago

Solved


longest common semi-substring
Finding longest common substring is a common problem in string processing. This problem is a variant of that. Two strings are...

10 years ago

Solved


Esoteric Trigonometry
From Wikipedia: "All of the trigonometric functions of an angle θ can be constructed geometrically in terms of a unit circle cen...

10 years ago

Solved


Index one element in each vector of an array along a given dimension
Functions like min and max can return in their second output argument the index of the element in each vector along a particular...

10 years ago

Solved


Gene Sequence Contest: Retro
The <http://www.mathworks.com/matlabcentral/contest/contests/21/rules Full Gene Sequence Rules and examples>. This Challenge ...

10 years ago

Solved


Temperature Conversion Utility (Strings)
This is a follow-on problem to <http://www.mathworks.com/matlabcentral/cody/problems/2413-temperature-conversion-utility Problem...

10 years ago

Solved


Find the longest match inside two strings
Given two strings, find the longest string which is contained within both strings. e.g. the longest string that is contained ...

10 years ago

Solved


Arithmetic/geometric sequence, 50/50
a(1) = 0 a(2) = 1 a(2*N) = sqrt(a(2*N-1)*a(2*N+1)) a(2*N+1) = (a(2*N)+a(2*N+2))/2 given _n_ return _a(n)_

10 years ago

Solved


Eliminate Outliers Using Interquartile Range
Given a vector with your "data" find the outliers and remove them. To determine whether data contains an outlier: # Identi...

10 years ago

Solved


List of built-in demo images
Return a cell array containing the filenames for built-in images (e.g. cameraman.tif, coins.png). An optional input specifies wh...

10 years ago

Solved


GJam March 2016 IOW: Password Single
This Challenge is derived from <http://code.google.com/codejam/contest/8274486/dashboard#s=p3 GJam March 2016 Annual I/O for Pas...

10 years ago

Solved


Determine the full width at half max
Determine the full width at half max of a curve. The full width at half maximum (FWHM) is a parameter which is used for desc...

10 years ago

Solved


Leftovers? Again?!
I am thinking of a positive number X. To determine what number I am thinking of, I will give you two 1xN vectors. The first ve...

10 years ago

Load more