Community Profile

Contact

Top 1% contributor

21 downloads

5 months ago

Write a function that takes less than zero seconds to execute, as measured using tic and toc. For repeatability, the test case p...

Solve this!

6

3 years ago

In the Neural Network toolbox, each column is a sample, so you need to arrange your input matrix as PxA, and output matrix as 5x...

accepted

0

Answered 4 years ago

Find the length of the shortest path through the matrix from the top left to bottom right corner. You may move right, down, or d...

Tell me what day is it. Return the full name of the day of the week as a string. e.g. It's June 12th 2014, so your function s...

2

1 year ago

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 circle's radius, compute the circle's area. Use the built-in mathematical constant pi.

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

Calculate the number of horns on a *unicorn*! And I'm talking about a unicorn with not more than one horn on it!

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

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

Given a vector of experimental data, D, and a vector of truth data, T, return FALSE if any +/- errors (D-T) are outside a given ...

Check the test suite to determine the relationship between input integer scalar and output integer scalar.

Create a row array from 9 to 1, using the double colon operator.

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

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

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

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

If the input string s is a word like 'hello', then the output word product p is a number based on the correspondence a=1, b=2, ....

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

Return the top k elements of an input vector. A comparison function compareFcn(m,n) is provided to compare individual elements o...

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

<http://en.wikipedia.org/wiki/Connect_Four Connect Four> is a game where you try to get four pieces in a row. For this problem, ...

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

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

Regardless of input, output the string 'yes'.

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

Given an integer n >= 0, generate the length n+1 row vector representing the n-th row of <http://en.wikipedia.org/wiki/Pascals_t...

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

Load more