Solved

(Linear) Recurrence Equations - Generalised Fibonacci-like sequences

This problem is inspired by problems <http://uk.mathworks.com/matlabcentral/cody/problems/2187-generalized-fibonacci 2187>, <htt...

4달 ago

Solved

Iccanobif numbers 1

There are a lot of problems in Cody that deal with Fibonacci numbers (1, 1, 2, 3, 5, 8, 13, 21 etc...) so let's turn things arou...

4달 ago

Solved

Fibonacci Decomposition

Every positive integer has a unique decomposition into nonconsecutive Fibonacci numbers f1+f2+ ... Given a positive integer n, r...

4달 ago

Solved

How many Fibonacci numbers?

Find the number of unique Fibonacci numbers (don't count repeats) in a vector of positive integers. Example: x = [1 2 3 4...

4달 ago

Solved

Find my daddy long leg (No 's')

Given the ratio of the two legs (longer / shorter), and the hypotenuse length, find the value of the bigger leg.

4달 ago

Solved

Is the Point in a Triangle?

Check whether a point or multiple points is/are in a triangle with three corners Points = [x, y]; Triangle = [x1, y1; x...

5달 ago

Solved

Calculate the centroid of a triangle

Info: https://en.wikipedia.org/wiki/Centroid Example Input: x = [0 0 1]; % x-coordinate y = [0 1 0]; % y-coordinat...

5달 ago

Solved

Find the sides of an isosceles triangle when given its area and height from its base to apex

Find the sides of an isosceles triangle when given its area and the height from its base to apex. For example, with A=12 and ...

5달 ago

Solved

Height of a right-angled triangle

Given numbers a, b and c, find the height of the right angled triangle with sides a and b and hypotenuse c, for the base c. If a...

5달 ago

Solved

Can we make a triangle?

Given three positive number, check whether a triangle can be made with these sides length or not. remember that in a triangle su...

5달 ago

Solved

Pi Estimate 1

Estimate Pi as described in the following link: <http://www.people.virginia.edu/~teh1m/cody/Pi_estimation1.pdf>

5달 ago

Solved

Given a square and a circle, please decide whether the square covers more area.

You know the side of a square and the diameter of a circle, please decide whether the square covers more area.

5달 ago

Solved

Circular Primes (based on Project Euler, problem 35)

The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime. The...

5달 ago

Solved

Find the next prime number

Find the next prime number or numbers for given n. For example: n = 1; out = 2; or n = [5 7]; out = [7 11]; ...

5달 ago

Solved

There are 10 types of people in the world

Those who know binary, and those who don't. The number 2015 is a palindrome in binary (11111011111 to be exact) Given a year...

5달 ago

Solved

Find the next Fibonacci number

In the sequence of Fibonacci numbers, every number is the sum of the two preceding ones: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55...

5달 ago

Solved

Return fibonacci sequence do not use loop and condition

Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: ...

5달 ago

Solved

Get all prime factors

List the prime factors for the input number, in decreasing order. List each factor. If the prime factor occurs twice, list it as...

5달 ago

Solved

Find the maximum number of decimal places in a set of numbers

Given a vector or matrix of values, calculate the maximum number of decimal places within the input. Trailing zeros do not coun...

5달 ago

Solved

Natural numbers in string form

Create a cell array of strings containing the first n natural numbers. _Slightly_ harder than it seems like it should be. Ex...

5달 ago

Solved

Fix the last element of a cell array

Note: this is lifted directly from <http://www.mathworks.com/matlabcentral/answers/82825-puzzler-for-a-monday Puzzler for a Mond...

5달 ago

Solved

Remove element(s) from cell array

You can easily remove an element (or a column in any dimension) from a normal matrix, but assigning that value (or range) empty....

5달 ago

Solved

Converting binary to decimals

Convert binary to decimals. Example: 010111 = 23. 110000 = 48.

5달 ago

Solved

Binary code (array)

Write a function which calculates the binary code of a number 'n' and gives the result as an array(vector). Example: Inpu...

5달 ago

Solved

Find out sum and carry of Binary adder

Find out sum and carry of a binary adder if previous carry is given with two bits (x and y) for addition. Examples Previo...

5달 ago

Solved

Mersenne Primes vs. All Primes

A Mersenne prime (M) is a prime number of the form M = 2^p - 1, where p is another prime number. <https://www.mathworks.com/matl...

5달 ago

Solved

Approximation of Pi (vector inputs)

Pi (divided by 4) can be approximated by the following infinite series: pi/4 = 1 - 1/3 + 1/5 - 1/7 + ... For a given numbe...

5달 ago

Solved

Approximation of Pi

Pi (divided by 4) can be approximated by the following infinite series: pi/4 = 1 - 1/3 + 1/5 - 1/7 + ... For a given numbe...

5달 ago