Make a checkerboard matrix
Given an integer n, make an n-by-n matrix made up of alternating ones and zeros as shown below. The a(1,1) should be 1.
Examp...
5 years ago
Solved
Remove all the consonants
Remove all the consonants in the given phrase.
Example:
Input s1 = 'Jack and Jill went up the hill';
Output s2 is 'a ...
5 years ago
Solved
Remove any row in which a NaN appears
Given the matrix A, return B in which all the rows that have one or more <http://www.mathworks.com/help/techdoc/ref/nan.html NaN...
5 years ago
Solved
Making change
Given an amount of currency, return a vector of this form:
[100 50 20 10 5 2 1 0.5 0.25 0.1 0.05 0.01]
Example:
Input a = ...
5 years ago
Solved
Which values occur exactly three times?
Return a list of all values (sorted smallest to largest) that appear exactly three times in the input vector x. So if
x = [1 2...
5 years ago
Solved
Indexed Probability Table
This question was inspired by a Stack Overflow question forwarded to me
by Matt Simoneau.
Given a vector x, make an indexed pro...
5 years ago
Solved
Find the two most distant points
Given a collection of points, return the indices of the rows that contain the two points most distant from one another. The inpu...
5 years ago
Solved
Which doors are open?
There are n doors in an alley. Initially they are all shut. You have been tasked to go down the alley n times, and open/shut the...
5 years ago
Solved
7 segment LED display
Given a whole number, output how many segments would be lit up to display it on a 7 segment LED display (see Wikipedia: <http://...
5 years ago
Solved
Pizza!
Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.]
Non-scor...
5 years ago
Solved
Too mean-spirited
Find the mean of each consecutive pair of numbers in the input row vector. For example,
x=[1 2 3] ----> y = [1.5 2.5]
x=[1...