Community Profile

Contact

Top 5% contributor

Hi Richard, I did quick search and came across this: http://www.mathworks.de/matlabcentral/answers/32558#comment_69878 It appe...

1294 views

Responded 2 years ago

Output logical "true" if the input is the answer to life, the universe and everything. Otherwise, output logical "false".

Solve this!

2 years ago

1:3 -> 0; 3:5 -> 6

Given an input number representing the number of bottles of beer on the wall, output how many are left if you take one down and ...

Return 1 if the input is sorted from highest to lowest, 0 if not. Example: 1:7 -> 0 [7 5 2] -> 1

*Description* Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. *Example* [x1,x2] =...

At one time or another, we all had to memorize boring times tables. 5 times 5 is 25. 5 times 6 is 30. 12 times 12 is way more th...

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

Check if sorted. Example: Input x = [1 2 0] Output y is 0

Add the numbers given in the cell array of strings. The strings represent amounts of money using this notation: $99,999.99. E...

A pangram, or holoalphabetic sentence, is a sentence using every letter of the alphabet at least once. Example: Input s ...

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

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

Given a string such as s = '011110010000000100010111' find the length of the longest string of consecutive 1's. In this examp...

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

This example comes from Steve Eddins' blog: <http://blogs.mathworks.com/steve/2009/05/27/learning-lessons-from-a-one-liner/ Lear...

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

Given a vector of numbers, return true if one of the numbers is a square of one of the other numbers. Otherwise return false. E...

Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.] Non-scor...

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

Remove all the consonants in the given phrase. Example: Input s1 = 'Jack and Jill went up the hill'; Output s2 is 'a ...

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

Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...

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

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

Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: Inpu...

Return true if the elements of the input vector increase monotonically (i.e. each element is larger than the previous). Return f...

Regardless of input, output the string 'yes'.

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

Triangle numbers are the sums of successive integers. So 6 is a triangle number because 6 = 1 + 2 + 3 which can be displa...

3 years ago

Load more