Solved

Sum of series IV

What is the sum of the following sequence: Σ(-1)^(k+1) (2k-1)^2 for k=1...n for different n?

4 maanden ago

Solved

Sum of series II

What is the sum of the following sequence: Σ(2k-1)^2 for k=1...n for different n?

4 maanden ago

Solved

Diophantine Equations (Inspired by Project Euler, problem 66)

Consider the quadratic Diophantine equation of the form: x^2 – Dy^2 = 1 When D=13, the minimal solution in x is 649^2 – 13...

4 maanden ago

Solved

Find the area of a triangle

Given a triangle with a base b and height h, return the triangle area.

4 maanden ago

Solved

Number of Even Elements in Fibonacci Sequence

Find how many even Fibonacci numbers are available in the first d numbers. Consider the following first 14 numbers 1 1 2...

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

4 maanden ago

Solved

Return the Fibonacci Sequence

Write a code which returns the Fibonacci Sequence such that the largest value in the sequence is less than the input integer N. ...

4 maanden 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: ...

4 maanden ago

Solved

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

4 maanden ago

Solved

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

4 maanden ago

Solved

Matlab Basics - Create a row vector

Write a Matlab script to create a row vector of 10 consecutive numbers x = [1 2 3 4 5 6 7 8 9 10]

4 maanden ago

Solved

Back to basics 22 - Rotate a matrix

Covering some basic topics I haven't seen elsewhere on Cody. Rotate the input matrix 90 degrees counterclockwise (e.g. [1 2; ...

4 maanden ago

Solved

Matlab Basics II - Max & Index of Max

Write a function that takes a vector x, then returns both the max value in x and its location in the vector for example x ...

4 maanden ago

Solved

How to find the position of an element in a vector without using the find function

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

4 maanden ago

Solved

Sum of series I

What is the sum of the following sequence: Σ(2k-1) for k=1...n for different n?

4 maanden ago

Solved

Vector Multiplication

Vector Multiplication of three matrix as shown in test cases.

4 maanden ago

Solved

Output any real number that is neither positive nor negative

Output any real number that is neither positive nor negative

4 maanden ago

Solved

Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]

The given function returns the index of the maximum value in a given matrix. such as X=[4,3,4,5,9,12,0,5] Ans= 6 if maxim...

4 maanden ago

Solved

The Hitchhiker's Guide to MATLAB

Output logical "true" if the input is the answer to life, the universe and everything. Otherwise, output logical "false".

4 maanden ago

Solved

Element by element multiplication of two vectors

Given two input vectors, return the element-by-element product. Example A = [1 2 3] B = [7 3 1] The answer should be...

4 maanden ago

Solved

Create an index-powered vector

Given a input vector x, return y as index-powered vector as shown below. Example x = [2 3 6 9] then y should be [...

4 maanden ago

Solved

Distance walked 1D

Suppose you go from position 7 to 10 to 6 to 4. Then you have walked 9 units of distance, since 7 to 10 is 3 units, 10 to 6 is 4...

4 maanden ago

Solved

Test Problem; Create a 5x5 array containing all ones

This is a test for learning the process of creating a Cody problem. The goal of this test problem will be to create an array,...

4 maanden ago

Solved

Flipping

Write code that can reverse the vector without using any sort of loop. Example Given the input vector A = [ 1 2 3 4 5...

4 maanden ago

Solved

Sum of series III

What is the sum of the following sequence: Σ(2k-1)^3 for k=1...n for different n?

4 maanden ago

Solved

Count decimal digits of a number

* Given an integer number you have to return the number of its digits. * For example 248 has 3 digits and 1589 has 4 digits ...

4 maanden ago

Solved

Try 1.5.4: Celsius to Fahrenheit

Write a program to convert an input given in Celsius to Fahrenheit. Examples: Input celsiusValue = 100 Output fahrValu...

4 maanden ago

Solved

Compare two input matrices

Check which input matrix has more elements. Return "1" if matrix A has more elements than matrix B. Otherwise return "0". Exa...

4 maanden ago