Community Profile

Contact

Top 5% contributor

Given a string with text and digits, add all the numbers together. Examples: Input str = '4 and 20 blackbirds baked in a...

Solve this!

1 year ago

Given a "counting sequence" vector x, construct the original sequence y. A counting sequence is formed by "counting" the entrie...

Replace NaNs with the number that appears to its left in the row. If there are more than one consecutive NaNs, they should all ...

Some numbers like 323 are palindromes. Other numbers like 124 are not. But look what happens when we add that number to a revers...

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

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

Sort the given list of numbers |a| according to how far away each element is from the target value |t|. The result should return...

Given a positive, scalar integer n, create a (2^n)-by-n double-precision matrix containing the binary numbers from 0 through 2^n...

you just measured its surface area, that is the input.

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

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

Again, as in "Is my wife right?" ( <http://www.mathworks.com/matlabcentral/cody/problems/149-is-my-wife-right> ), answer 'yes' r...

2 years ago

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

The <http://en.wikipedia.org/wiki/Goldbach's_conjecture Goldbach conjecture> asserts that every even integer greater than 2 can ...

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

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

Write a function posX=findPosition(x,y) where x is a vector and y is the number that you are searching for. Examples: fin...

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

Reverse the vector elements. Example: Input x = [1,2,3,4,5,6,7,8,9] Output y = [9,8,7,6,5,4,3,2,1]

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

Given a string s1, find all occurrences of the single quote character and replace them with two occurrences of the single quote ...

Write a two-input, two-output function that swaps its two input arguments. For example: [q,r] = swap(5,10) returns q = ...

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

Suppose you go from position 7 to 10 to 6 to 4. Then you have walked 9 units of distance, since 7 to 10 is 3 units, 10 to 6 is 4...

You are given a cell array of strings and a string delimiter. You need to produce one string which is composed of each string fr...

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

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

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

You have a two vectors, a and b. They are monotonic and the same length. Given a value, va, where va is between a(1) and a(end...

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

Load more