Pell numbers
Find the nth pell number
<https://en.wikipedia.org/wiki/Pell_number>
5年以上 前
解決済み
Bell Triangle
Form the bell triangle upto nth bell number posotion;
* if n=5
*
y= [1 0 0 0 0;
1 2 0 0...
5年以上 前
解決済み
Frugal number
check whether n is a frugal number
* a frugal number is a natural number in a given number base that has more digits than the...
5年以上 前
解決済み
Iccanobif numbers 1
There are a lot of problems in Cody that deal with Fibonacci numbers (1, 1, 2, 3, 5, 8, 13, 21 etc...) so let's turn things arou...
5年以上 前
解決済み
Last non-zero digit
Given a number n, find the last non-zero digit of the factorial of that number.
You need to take care of the large values of n....
Go to the head of the class!
You're given a matrix and a single number. If that number is in the matrix, reorder the matrix so that number is in the first r...
5年以上 前
解決済み
Must be in the front row...
You are given a matrix followed by a single number. Your object is to write a script that will shift the matrix around so that ...
5年以上 前
解決済み
Replace Nonzero Numbers with 1
Given the matrix x, return the matrix y with non zero elements replaced with 1.
Example:
Input x = [ 1 2 0 0 0
...
5年以上 前
解決済み
Matrix multiplication across rows
Given matrix m, return matrix n such that, rows of n are result of multiplication of the rows of the input matrix
Example
...
5年以上 前
解決済み
A matrix of extroverts
Now that the introverts have had their script, the extroverts spoke up (naturally!) and demanded one as well. You will be given...
matrix zigzag
Unfold a 2-D matrix to a 1-D array in zig-zag order, e.g., for matrix
[ 1 2 3 ;
4 5 6 ;
7 8 9 ]
the resulting 1-...
5年以上 前
解決済み
Too Many Zeros, Dump Them!
Sometimes when I create a matrix, I use this syntax:
a = zeros(1000,1000);
But when the function ends, I find that I don'...
5年以上 前
解決済み
subtract central cross
Given an n-by-n square matrix, where n is an odd number, return the matrix without the central row and the central column.
5年以上 前
解決済み
frame of the matrix
Given the matrix M, return M without the external frame.