Risolto


Draw 'O' !
Given n as input, generate a n-by-n matrix 'O' using 0 and 1 . example: n=4 ans= [1 1 1 1 1 0 0 1 ...

quasi 4 anni fa

Risolto


Draw a '5' in a zero matrix!

quasi 4 anni fa

Risolto


Draw a '2' in a zero matrix!

quasi 4 anni fa

Risolto


Draw a '1' in a zero matrix!

quasi 4 anni fa

Risolto


Draw a '4' in a zero matrix!

quasi 4 anni fa

Risolto


Draw a '3' in a zero matrix!

quasi 4 anni fa

Risolto


Draw a '9' in a zero matrix!

quasi 4 anni fa

Risolto


Draw a '8' in a zero matrix!

quasi 4 anni fa

Risolto


Draw a '6' in a zero matrix!

quasi 4 anni fa

Risolto


Draw a '7' in a zero matrix!

quasi 4 anni fa

Risolto


Summy's even sum

quasi 4 anni fa

Risolto


Summy's odd sum

quasi 4 anni fa

Risolto


Combinations without using nchoosek
You have to generate a matrix with all possible combinations of n elements *taken 2* at a time, *without using nchoosek(1:n,2)* ...

quasi 4 anni fa

Risolto


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

quasi 4 anni fa

Risolto


Compute Fibonacci Number
Compute the _n_-th Fibonacci Number f(0) = 0, f(1) = 1, f(2) = 1, f(3) = 2, ... f(42) = 267914296

quasi 4 anni fa

Risolto


Determine if given number is perfect
A number is <http://en.wikipedia.org/wiki/Perfect_number perfect> if it is equal to the sum of its factors, excluding itself. ...

quasi 4 anni fa

Risolto


That's some divisor you've got there...
Given a positive integer x, calculate the sum of all of the divisors of the number. Please include the number itself in your fi...

quasi 4 anni fa

Risolto


Divisors of an integer
Given a number N, return a vector V of all integers that divide N. For example, N = 10 Then V=[1 2 5 10]

quasi 4 anni fa

Risolto


Amicable numbers
Test whether two numbers are <https://en.wikipedia.org/wiki/Amicable_numbers amicable>, meaning that the sum of the proper divis...

quasi 4 anni fa

Risolto


prime to each other
Given two integers n1, n2 greater than 1, find out if they have common divisors or are prime to each other. Return "true" if the...

quasi 4 anni fa

Risolto


Determine if input is a perfect number
A <http://en.wikipedia.org/wiki/Perfect_number/ perfect number> occurs whent the sum of all divisors of a positive integer, exce...

quasi 4 anni fa

Risolto


find "greatest common divisor" of two integer value
A function to find Greatest Common Divisor of two integer input E.G. x=-18 y=96 output should be +6 x=-18; y=96; >>your...

quasi 4 anni fa

Risolto


Divisors

quasi 4 anni fa

Risolto


Create a matrix X, where each column is a shifted copy of the vector v
Example : in->v = (1:5)'; 1 2 3 4 5 out-> [1 5 4 3 2;2 1 5 4 3;3 2 1 5 4;4 3 2 1 5;5 4 3 ...

quasi 4 anni fa

Risolto


Mirror Image matrix across anti-diagonal
Given an input number x, create a mirror image matrix 'Y' across the anti-diagonal. For example, if x=3, Y = [1 2 3; ...

quasi 4 anni fa

Risolto


Generate this matrix
Generate the following matrix. n = 2; out = [-4 -3 -2 -1 0 -3 -2 -1 0 1 -...

quasi 4 anni fa

Risolto


ZigZag matrix with reflected format
ZigZag MATRIX with REFLECTED format. We have only input x. We have to create a matrix in the following pattern. input n=5...

quasi 4 anni fa

Risolto


Pascal's Matrix
Given an integer n &ge; 0, generate the ( _n_+1) &times; ( _n_+1) lower triangular <http://en.wikipedia.org/wiki/Pascal_matrix P...

quasi 4 anni fa

Risolto


Symmetric matrix
You must create a n-by-n *symmetric* matrix such that A(row,col) = row/col for col >= row. Example if n =3 : output is : ...

quasi 4 anni fa

Risolto


Make a Star Pyramid
Create a star pyramid. First line will have 1 star, second will have two stars and so on... a basic program which is easily done...

quasi 4 anni fa

Carica altro