已解决


Back to basics 13 - Input variables
Covering some basic topics I haven't seen elsewhere on Cody. Return as a string the name of the input variable to the functio...

21 days 前

已解决


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

22 days 前

已解决


Converts numbers into characters
Converts numbers into characters

22 days 前

已解决


Find the nth composite number.
Everyone heard about the nth prime number. Let's try to find out the nth composite. For example , 1 is the first composite, 10 i...

23 days 前

已解决


Project Euler: Problem 10, Sum of Primes
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below the input, N. Thank you <http:/...

24 days 前

已解决


"Look and say" sequence
What's the next number in this sequence? * [0] * [1 0] * [1 1 1 0] * [3 1 1 0] * [1 3 2 1 1 0] This a variant on the w...

24 days 前

已解决


Golomb's self-describing sequence (based on Euler 341)
The Golomb's self-describing sequence {G(n)} is the only nondecreasing sequence of natural numbers such that n appears exactly G...

25 days 前

已解决


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

25 days 前

已解决


Find the logic and return the nth number
given a sequence of numbers arranged in the following order: A=0,1,3,4,9,10,12,13,27,28,30,31,36,37,...... Write a function th...

26 days 前

已解决


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

28 days 前

已解决


Find nth number
The numbers 2 and 7 are called lucky numbers, an integer containing only the digits 2 and 7 is also called lucky number. The pro...

28 days 前

已解决


Find the Nth Root of a Given Number
Find the Nth root of a given number x. Examples x = 4096 n = 4 y = 8 x = 625 n = 5 y = 3.6239

29 days 前

已解决


Find nth maximum
Find nth maximum in a vector of integer numbers. Return NaN if no such number exists. x = [2 6 4 9 -10 3 1 5 -10]; So ...

29 days 前

已解决


Find the index of nth maximum of a row vector of real numbers
Given a vector of real numbers x, find the index idx of _n_ th maximum value. If nth maximum occurs more than once, return the i...

29 days 前

已解决


find nth even fibonacci number
1st even fibonacci number=2 ; 2nd even fibonacci number=8 ..

29 days 前

已解决


Sum of first n terms of a harmonic progression
Given inputs a, d and n, return the sum of the first n terms of the harmonic progression a, a/(1+d), a/(1+2d), a/(1+3d),....

29 days 前

已解决


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

29 days 前

已解决


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

30 days 前

已解决


Is X a Fibonacci Matrix?
In honor of Cleve's new blog and post: <http://blogs.mathworks.com/cleve/2012/06/03/fibonacci-matrices/> Is X a Fibonacci ...

30 days 前

已解决


Find all the indices when a value repetition occurs
Find all the sequences of consecutive repeated numbers in a numeric array, returning the indices where each sequence starts and ...

1 month 前

已解决


Doubling elements in a vector
Given the vector A, return B in which all numbers in A are doubling. So for: A = [ 1 5 8 ] then B = [ 1 1 5 ...

1 month 前

已解决


Whether the input is vector?
Given the input x, return 1 if x is vector or else 0.

1 month 前

已解决


Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1. Hint: use increment.

1 month 前

已解决


Create a vector
Create a vector from 0 to n by intervals of 2.

1 month 前

已解决


Flip the vector from right to left
Flip the vector from right to left. Examples x=[1:5], then y=[5 4 3 2 1] x=[1 4 6], then y=[6 4 1]; Request not to use d...

1 month 前

已解决


Find max
Find the maximum value of a given vector or matrix.

1 month 前

已解决


Get the length of a given vector
Given a vector x, the output y should equal the length of x.

1 month 前

已解决


Inner product of two vectors
Find the inner product of two vectors.

1 month 前

已解决


Arrange Vector in descending order
If x=[0,3,4,2,1] then y=[4,3,2,1,0]

1 month 前

已解决


Integer Sequence - II : New Fibonacci
Crack the following Integer Sequence. (Hints : It has been obtained from original Fibonacci Sequence and all the terms are also ...

1 month 前

加载更多