Solved

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

nästan 5 år ago

Solved

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

nästan 5 år ago

Solved

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

nästan 5 år ago

Solved

Is my wife right?
Regardless of input, output the string 'yes'.

nästan 5 år ago

Solved

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

nästan 5 år ago

Solved

Multiply 2 numbers
Very easy, you just have to multiply 2 numbers but you cannot use the following signs (*, /, - ,^) ,mtimes , times, cross, pro...

nästan 5 år ago

Solved

Spot the rectangle (Part 2)
This problem is related to the <http://bit-player.org/2009/the-17x17-challenge 17x17 challenge>. See also <http://www.mathworks....

nästan 5 år ago

Solved

Spot the rectangle
This problem is related to the <http://bit-player.org/2009/the-17x17-challenge 17x17 challenge>. Given a matrix filled with ones...

nästan 5 år ago

Solved

Create a patchwork matrix
This function will assemble a large matrix out of a number of smaller ones m1, m2, etc., according to a pattern P. If P is 3x5,...

nästan 5 år ago

Solved

Make a Star Pyramid
Create a star pyramid. First line will have 1 star, second will have two stars and so on... a basic program which is easily done...

nästan 5 år ago

Solved

Spiral In
Create an m by n matrix filled with sequential integers starting from 1 and arranged in a counterclockwise spiral that hugs the ...

nästan 5 år ago

Solved

Mirror Image matrix across anti-diagonal
Given an input number x, create a mirror image matrix 'Y' across the anti-diagonal. For example, if x=3, Y = [1 2 3; ...

nästan 5 år ago

Solved

Reverse the elements of an array
Reverse the order of elements in an array: eg: input X = [ 1 2 3 ; 4 5 6 ; 7 8 9 ] o...

nästan 5 år ago

Solved

Flip the main diagonal of a matrix
Given a n x n matrix, M, flip its main diagonal. Example: >> M=magic(5); >> flipDiagonal(M) 9 24 1 ...

nästan 5 år ago

Solved

Create a matrix X, where each column is a shifted copy of the vector v
Example : in->v = (1:5)'; 1 2 3 4 5 out-> [1 5 4 3 2;2 1 5 4 3;3 2 1 5 4;4 3 2 1 5;5 4 3 ...

nästan 5 år ago

Solved

Symmetric matrix
You must create a n-by-n *symmetric* matrix such that A(row,col) = row/col for col >= row. Example if n =3 : output is : ...

nästan 5 år ago

Solved

Special matrix
Make a square matrix with this shape. For n=4 M = 1 1 0 0 1 0 1 0 0 1 0 ...

nästan 5 år ago

Solved

Better bullseye matrix
<http://www.mathworks.com/matlabcentral/cody/problems/18-bullseye-matrix Problem 18> asks to create a bullseye matrix like this:...

nästan 5 år ago

Solved

Create a Multiplication table matrix...
Create a product table in this format: P = [ 1 2 3 4 5; 2 4 6 8 10; 3 6 9 12 15; 4 8 12 1...

nästan 5 år ago

Solved

"mirror" matrix
Create n x 2n "mirror" matrix of this type: Examples For n = 2 m = [ 1 2 2 1 1 2 2 1 ] For n = 3 m = ...

nästan 5 år ago

Solved

Magic is simple (for beginners)
Determine for a magic square of order n, the magic sum m. For example m=15 for a magic square of order 3.

nästan 5 år ago

Solved

Project Euler: Problem 2, Sum of even Fibonacci
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 te...

nästan 5 år ago

Solved

Alternating sum
Given vector x, calculate the alternating sum y = x(1) - x(2) + x(3) - x(4) + ...

nästan 5 år ago

Solved

Project Euler: Problem 6, Natural numbers, squares and sums.
The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ...

nästan 5 år ago

Solved

Sum all integers from 1 to 2^n
Given the number x, y must be the summation of all integers from 1 to 2^x. For instance if x=2 then y must be 1+2+3+4=10.

nästan 5 år ago

Solved

Divisible by n, prime divisors from 20 to 200
Pursuant to the previous problem (linked below), this problem requires a function that checks for divisibility of large numbers ...

nästan 5 år ago

Solved

Divisible by n, Truncated-number Divisors
Some divisors only require a few numbers at the end of the number in question to determine divisibility, no matter how long. Exa...

nästan 5 år ago

Solved

Divisible by n, Composite Divisors
Pursuant to <http://www.mathworks.com/matlabcentral/cody/problems/42453-divisible-by-n-prime-vs-composite-divisors Divisible by ...

nästan 5 år ago

Solved

Divisible by n, prime divisors - 11, 13, 17, & 19
Divisibility checks against prime numbers can all be accomplished with the same routine, applied recursively, consisting of add ...

nästan 5 år ago

Solved

Divisible by n, prime divisors (including powers)
For this problem, you will be provided an array of numbers (not necessarily in order). Return the array of numbers with only pri...

nästan 5 år ago