解決済み

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?

2ヶ月 前

解決済み

Sum of series II

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

2ヶ月 前

解決済み

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

2ヶ月 前

解決済み

Find the area of a triangle

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

2ヶ月 前

解決済み

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

2ヶ月 前

解決済み

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

2ヶ月 前

解決済み

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

2ヶ月 前

解決済み

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

2ヶ月 前

解決済み

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

2ヶ月 前

解決済み

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

2ヶ月 前

解決済み

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]

2ヶ月 前

解決済み

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

2ヶ月 前

解決済み

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

2ヶ月 前

解決済み

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

2ヶ月 前

解決済み

Sum of series I

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

2ヶ月 前

解決済み

Output any real number that is neither positive nor negative

Output any real number that is neither positive nor negative

2ヶ月 前

解決済み

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

2ヶ月 前

解決済み

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

2ヶ月 前

解決済み

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

2ヶ月 前

解決済み

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

2ヶ月 前

解決済み

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

2ヶ月 前

解決済み

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

2ヶ月 前

解決済み

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

2ヶ月 前

解決済み

Sum of series III

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

2ヶ月 前

解決済み

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

2ヶ月 前

解決済み

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

2ヶ月 前

解決済み

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

2ヶ月 前