Remove the air bubbles
Given a matrix a, return a matrix b in which all the zeros have "bubbled" to the top. That is, any zeros in a given column shoul...
6年弱 前
解決済み
Fibonacci-Sum of Squares
Given the Fibonacci sequence defined by the following recursive relation,
* F(n) = F(n-1) + F(n-2)
* where F(1) = 1 and F(1)...
6年弱 前
解決済み
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...
6年弱 前
解決済み
Fibonacci Decomposition
Every positive integer has a unique decomposition into nonconsecutive Fibonacci numbers f1+f2+ ... Given a positive integer n, r...
6年弱 前
解決済み
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 ...
6年弱 前
解決済み
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...
6年弱 前
解決済み
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. ...
6年弱 前
解決済み
Fibonacci sequence
Calculate the nth Fibonacci number.
Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ...
Examples:
Inpu...
6年弱 前
解決済み
Find the product of a Vector
How would you find the product of the vector [1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0] times 2?;
x = [1 : 0.5 : 6];
y ...
6年弱 前
解決済み
Divide by 4
Given the variable x as your input, divide it by 4 and put the result in y.
Numbers spiral diagonals (Part 1)
Inspired by Project Euler n°28 et 58.
A n x n spiral matrix is obtained by starting with the number 1 and moving to the right...
6年弱 前
解決済み
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".
6年弱 前
解決済み
Create a two dimensional zero matrix
You have to create a zero matrix of size (mxn) whose inputs are m and n and the elements of your matrix should be zeros.
Exam...
6年弱 前
解決済み
Find the minimal value in N*N Matrix
Suppose that we have N by N matrix, we try to find the minimal value in that matrix.
examples:
Input A=[1 2 3 5 6;52 58 56 45...
Numbers spiral diagonals (Part 2)
Inspired by Project Euler n°28 and 58.
A n x n spiral matrix is obtained by starting with the number 1 and moving to the righ...
6年弱 前
解決済み
Prime Ladders
A <http://en.wikipedia.org/wiki/Word_ladder word ladder> transforms one word to another by means of single-letter mutations. So ...