解決済み

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

9ヶ月 前

解決済み

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

9ヶ月 前

解決済み

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

9ヶ月 前

解決済み

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

9ヶ月 前

解決済み

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

9ヶ月 前

解決済み

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

9ヶ月 前

解決済み

Convert a numerical matrix into a cell array of strings

Given a numerical matrix, output a *cell array of string*. For example: if input = 1:3 output is {'1','2','3'} whic...

9ヶ月 前

解決済み

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

9ヶ月 前

解決済み

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

9ヶ月 前

解決済み

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

9ヶ月 前

解決済み

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.

9ヶ月 前

解決済み

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

9ヶ月 前

解決済み

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

9ヶ月 前

解決済み

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

9ヶ月 前

解決済み

Converting binary to decimals

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

9ヶ月 前

解決済み

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

9ヶ月 前

解決済み

Relative ratio of "1" in binary number

Input(n) is positive integer number Output(r) is (number of "1" in binary input) / (number of bits). Example: * n=0; r=...

9ヶ月 前

解決済み

Convert given decimal number to binary number.

Convert given decimal number to binary number. Example x=10, then answer must be 1010.

9ヶ月 前

解決済み

Bit Reversal

Given an unsigned integer _x_, convert it to binary with _n_ bits, reverse the order of the bits, and convert it back to an inte...

9ヶ月 前

解決済み

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

9ヶ月 前

解決済み

Sum the entries of each column of a matrix which satisfy a logical condition.

Given a numeric matrix A and a logical array L of the same size as A, return a row vector S containing the columnwise sums of th...

9ヶ月 前

解決済み

Go-style solver

Consider a variation of the game Go where one player has gone ahead and placed several pieces all at once. Assuming that the sec...

9ヶ月 前

解決済み

Wheat on a chessboard pt 2

If a chessboard were to have wheat placed upon each square such that x grains were placed on the first square and each successiv...

9ヶ月 前

解決済み

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

9ヶ月 前

解決済み

Proper Factors

Generate the proper factors of input integer _x_ and return them in ascending order. For more information on proper factors, ref...

9ヶ月 前

解決済み

Multiples of a Number in a Given Range

Given an integer factor _f_ and a range defined by _xlow_ and _xhigh_ inclusive, return a vector of the multiples of _f_ that fa...

9ヶ月 前

解決済み

Numbers with prime factors 2, 3 and 5.

Make a function which takes one positive integer n and returns a matrix with the numbers of the form (2^i)*(3^j)*(5^k) which are...

9ヶ月 前

解決済み

Project Euler: Problem 3, Largest prime factor

The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number being input, input might be ui...

9ヶ月 前

解決済み

Vector creation

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

9ヶ月 前

解決済み

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

9ヶ月 前