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

16 days ago

Solved


Return the largest number that is adjacent to a zero
This example comes from Steve Eddins' blog: <http://blogs.mathworks.com/steve/2009/05/27/learning-lessons-from-a-one-liner/ Lear...

16 days ago

Solved


Sort a list of complex numbers based on far they are from the origin.
Given a list of complex numbers z, return a list zSorted such that the numbers that are farthest from the origin (0+0i) appear f...

16 days ago

Solved


The Goldbach Conjecture
The Goldbach conjecture asserts that every even integer greater than 2 can be expressed as the sum of two primes. Given the eve...

16 days ago

Solved


Bullseye Matrix
Given n (always odd), return output a that has concentric rings of the numbers 1 through (n+1)/2 around the center point. Exampl...

16 days ago

Solved


Remove the vowels
Remove all the vowels in the given phrase. Example: Input s1 = 'Jack and Jill went up the hill' Output s2 is 'Jck nd Jll wn...

16 days ago

Solved


Weighted average
Given two lists of numbers, determine the weighted average as follows Example [1 2 3] and [10 15 20] should result in 33.3...

16 days ago

Solved


Back and Forth Rows
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 wind back and forth along the rows as shown in the...

16 days ago

Solved


Most nonzero elements in row
Given the matrix a, return the index r of the row with the most nonzero elements. Assume there will always be exactly one row th...

16 days ago

Solved


Summing digits
Given n, find the sum of the digits that make up 2^n. Example: Input n = 7 Output b = 11 since 2^7 = 128, and 1 + ...

16 days ago

Solved


Return the 3n+1 sequence for n
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

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

16 days ago

Solved


Find the numeric mean of the prime numbers in a matrix.
There will always be at least one prime in the matrix. Example: Input in = [ 8 3 5 9 ] Output out is 4...

16 days ago

Solved


Who Has the Most Change?
You have a matrix for which each row is a person and the columns represent the number of quarters, nickels, dimes, and pennies t...

16 days ago

Solved


Roll the Dice!
Description Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. Example [x1,x2] = rollDice(...

16 days ago

Solved


Determine if input is a perfect number
A perfect number occurs whent the sum of all divisors of a positive integer, except the number itself, equals the number. Examp...

16 days ago

Solved


First N Perfect Squares
*Description* Return the first N perfect squares *Example* input = 4; output = [ 1 4 9 16 ];

16 days ago

Solved


linear least squares fitting
Inputs: * |f|: cell-array of function handles * |x|: column vector of |x| values * |y|: column vector of |y| values, same l...

16 days ago

Solved


Column norms of a matrix
Given a matrix M, return a vector y such that for each k y(k)=norm(M(:,k)) (y(k) is the Euclidean norm of the k-th col...

16 days ago

Solved


Find the minimum of the column-maximums of a matrix
Given a matrix A, find the maximum value of each column, then return the smallest of those maximum values (ie return the minimum...

16 days ago

Solved


Calculate the mean of each half of a matrix
Given a matrix with an even number of columns, n, return a 1-by-2 row vector where the first element is the mean of all the elem...

16 days ago

Solved


Find Closest Constant
Given a number x, return the value that is closest to x from this list of constants: 0, 1, , e, , (also known as ). For exampl...

16 days ago

Solved


Matrix Quadrants
Write a function that takes N as the input, and outputs a matrix whose upper-left (NxN) quadrant contains all ones, the lower-ri...

16 days ago

Solved


Not square-free number sequence
Not square-free numbers are all positive integers divisible by a square greater than one: 4, 8, 9, 12, 16, 18, 20, 24, 25, 27, ....

16 days ago

Solved


Find similar sequences
Another problem inspired by a question on the <http://www.mathworks.com/matlabcentral/answers answers> forum. Given a matrix ...

16 days ago

Solved


Generate Square Wave
Generate a square wave of desired length, number of complete cycles and duty cycle. Here, duty cycle is defined as the fraction ...

16 days ago

Solved


Find the Pattern 4

16 days ago

Solved


Find the Pattern 3

16 days ago

Solved


Find the Pattern 2

16 days ago

Solved


Find the Pattern 1

16 days ago

Load more