Community Profile

Contact

Top 1% contributor

*Description:* Determine if the elements of an input array are triangle numbers and return the result as an array with the sa...

Solve this!

4 months ago

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

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

Pizza prices are typically listed by diameter, rather than the more relevant feature of area. Compute a pizza's value (cost per ...

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

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

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

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

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

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

Remove all the redundant elements in a vector, but keep the first occurrence of each value in its original location. So if a =...

1 year ago

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

Given a Fahrenheit value F, convert to a Celsius value C. While the equation is C = 5/9 * (F - 32), as an exercise use two state...

Given a circle's radius, compute the circle's area. Use the built-in mathematical constant pi.

Given an hourly wage, compute an annual salary by multiplying the wage times 40 and times 50, because salary = wage x 40 hours/w...

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

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

You have a stack of tiles to put onto an array-like playing board. Each tile has a number (always an integer), and the board var...

Given a list of ordered pairs, and the order they should be placed in a line, find the sum of the absolute values of the differe...

A sequence of triangles is constructed in the following way: 1) the first triangle is Pythagoras' 3-4-5 triangle 2) the s...

Given four different positive numbers, a, b, c and d, provided in increasing order: a < b < c < d, find if any three of them com...

The longer side of a rectangle is three times the length of the shorter side. If the length of the diagonal is x, find the width...

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

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

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 any three positive numbers a, b, c, return true if the triangle with sides a, b and c is right-angled. Otherwise, return f...

Given three positive numbers a, b, c, where c is the largest number, return *true* if the triangle with sides a, b and c is righ...

If a rhombus has diagonals of length x and x+1, then what is the length of its side, y? <<http://upload.wikimedia.org/wikipe...

An isosceles triangle has equal sides of length x and a base of length y. Find the area, A, of the triangle. <<http://upload...

Calculate the area of an equilateral triangle of side x. <<http://upload.wikimedia.org/wikipedia/commons/e/e0/Equilateral-tr...

Load more

Choose your country to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a location from the following list:

See all countries