Solved


Find the sum of the elements in the "second" diagonal
Find the sum of the elements in the diagonal that starts at the top-right corner and ends at the bottom-left corner.

ungefär ett år ago

Solved


Back to basics 6 - Column Vector
Covering some basic topics I haven't seen elsewhere on Cody. Given an input vector, output true or false whether it is a colu...

ungefär ett år ago

Solved


Factorize THIS, buddy
List the prime factors for the input number, in decreasing order. List each factor only once, even if the factorization includes...

ungefär ett år ago

Solved


Add two numbers
Calculate the sum of two numbers. Example input = [2 3] output = 5

ungefär ett år ago

Solved


Right and wrong
Given a vector of lengths [a b c], determines whether a triangle with those sides lengths is a right triangle: <http://en.wikipe...

ungefär ett år ago

Solved


Back to basics 21 - Matrix replicating
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, generate an output matrix that consists o...

ungefär ett år ago

Solved


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

ungefär ett år ago

Solved


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

ungefär ett å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 ...

ungefär ett år ago

Solved


Sum of diagonal of a square matrix
If x = [1 2 4; 3 4 5; 5 6 7] then y should be the sum of the diagonals of the matrix y = 1 + 4 + 7 = 12

ungefär ett år ago

Solved


Tell me the slope
Tell me the slope, given a vector with horizontal run first and vertical rise next. Example input: x = [10 2];

ungefär ett år ago

Solved


Too mean-spirited
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...

ungefär ett år ago

Solved


Project Euler: Problem 1, Multiples of 3 and 5
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23...

ungefär ett år ago

Solved


Bottles of beer
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 ...

ungefär ett år ago

Solved


Divisible by 13
Write a function to determine if a number is divisible by 13. Similar to the number seven, this can be done by a few different m...

ungefär ett å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...

ungefär ett år ago

Solved


Divisible by n, prime vs. composite divisors
In general, there are two types of divisibility checks; the first involves composite divisors and the second prime divisors, inc...

ungefär ett år ago

Solved


Divisible by 11
Pursuant to the <http://www.mathworks.com/matlabcentral/cody/problems/42404-divisible-by-2 first problem> in this series, this o...

ungefär ett år ago

Solved


Divisible by 12
Write a function to determine if a number is divisible by 12. Similar to the number six, this can be done by checking for divisi...

ungefär ett år ago

Solved


Divisible by 14
Write a function to determine if a number is divisible by 14. If a number is <http://www.mathworks.com/matlabcentral/cody/proble...

ungefär ett år ago

Solved


Divisible by 15
Write a function to determine if a number is divisible by 15. If a number is <http://www.mathworks.com/matlabcentral/cody/proble...

ungefär ett år ago

Solved


Divisible by 16
Write a function to determine if a number is divisible by 16. This can be done by a few different methods. Here are two: # If...

ungefär ett år ago

Solved


Divisible by 10
Pursuant to the <http://www.mathworks.com/matlabcentral/cody/problems/42404-divisible-by-2 first problem> in this series, this o...

ungefär ett år ago

Solved


Divisible by 8
Pursuant to the <http://www.mathworks.com/matlabcentral/cody/problems/42404-divisible-by-2 first problem> in this series, this o...

ungefär ett år ago

Solved


Divisible by 9
Pursuant to the <http://www.mathworks.com/matlabcentral/cody/problems/42404-divisible-by-2 first problem> in this series, this o...

ungefär ett år ago

Solved


Divisible by 7
Pursuant to the <http://www.mathworks.com/matlabcentral/cody/problems/42404-divisible-by-2 first problem> in this series, this o...

ungefär ett år ago

Solved


Divisible by 6
Pursuant to the <http://www.mathworks.com/matlabcentral/cody/problems/42404-divisible-by-2 first problem> in this series, this o...

ungefär ett år ago

Solved


Divisible by 5
Pursuant to the <http://www.mathworks.com/matlabcentral/cody/problems/42404-divisible-by-2 first problem> in this series, this o...

ungefär ett år ago

Solved


Divisible by 4
Pursuant to the <http://www.mathworks.com/matlabcentral/cody/problems/42404-divisible-by-2 first problem> in this series, this o...

ungefär ett år ago

Solved


Divisible by 3
Pursuant to the <http://www.mathworks.com/matlabcentral/cody/problems/42404-divisible-by-2 first problem> in this series, this o...

ungefär ett år ago

Load more