A résolu


Create a Standard Size Vector
Given an input x, create a row vector y from 1 to x with 5 elements.

6 mois il y a

A résolu


Resizing Matrices
Take an 4x3 matrix, and resize it to a 2x6 matrix

6 mois il y a

A résolu


Finding an element in a vector
x is a vector of unknown length your function should return the index of the first element in the vector that is greater than...

6 mois il y a

A résolu


Draw a '9' in a zero matrix!

6 mois il y a

A résolu


Draw a '6' in a zero matrix!

6 mois il y a

A résolu


Draw a '7' in a zero matrix!

6 mois il y a

A résolu


Draw a '8' in a zero matrix!

6 mois il y a

A résolu


Draw a '5' in a zero matrix!

6 mois il y a

A résolu


Draw a '4' in a zero matrix!

6 mois il y a

A résolu


Draw a '3' in a zero matrix!

6 mois il y a

A résolu


Draw a '2' in a zero matrix!

6 mois il y a

A résolu


Draw a '1' in a zero matrix!

6 mois il y a

A résolu


Sum of Positive Elements in a Matrix
Given a matrix A, write a function that returns the sum of all positive elements in A. Input: A = [-3, 4, -1; 6, -2, 8] ...

6 mois il y a

A résolu


Sum of Even Numbers in a Vector
Write a function that takes a vector x as input and returns the sum of all even numbers in x. Input: x = [1, 2, 3, 4, 5, 6] ...

6 mois il y a

A résolu


0, 2, 0, -2, 0, 2, 0, -2, ...
Generate the first n terms of a periodic sequence defined as f(x) = 0, 2, 0, -2, 0, 2, 0, -2, ..., for x = 1, 2, 3, 4, 5, 6...

6 mois il y a

A résolu


Reverse a string
Reverse the given string. Example input = 'reverse' output = 'esrever'

6 mois il y a

A résolu


Find the largest number
Find the largest number |x| among 4 numbers given as variables |a|, |b|, |c|, and |d|. Example: Input: a = 4; b = 7; c ...

6 mois il y a

A résolu


How many days in a month?
Return the number of days in a given month in 2017. If the input is not a valid month number, return -1. Examples: Input...

6 mois il y a

A résolu


Separate even from odd numbers in a vector - without loops
*Without using loops*, rearrange a vector of integers such that the odd numbers appear at the beginning, and even numbers at the...

6 mois il y a

A résolu


Add a vector to a matrix
Given a matrix |mat| of size |mXn| and a row vector |v| of size |1Xs|, return a matrix with |m+1| rows that conatains |mat| over...

6 mois il y a

A résolu


Determine if a row vector has NaN
Determine if a row vector x has NaN

6 mois il y a

A résolu


Select primes from the matrix.
Select primes from the matrix.

6 mois il y a

A résolu


Sum positive elements of matrix.
Calculate sum of positive elements of the matrix.

6 mois il y a

A résolu


Ratio between sum of primes and sum of factors
Write a function that calculates the ratio between the sum of primes numbers lower or equal to x, and the sum of the factors of ...

6 mois il y a

A résolu


Alternating 1´s and 0´s in a matrix
Given an odd number n, write a function that creates a matrix y with dimension nxn alternating 1's and 0's, and starting with 1 ...

6 mois il y a

A résolu


Say type of roots in quadratic equation
Given the coefficients of a quadratic equation, write a function that gives the output y='RealDifferent' if the roots are real a...

6 mois il y a

A résolu


Get the mean digit
Write a function that gives the mean digit (round towards nearest integer) of an input and positive number. For example: x ...

6 mois il y a

A résolu


Ratio between sums of prime and non-prime numbers
Write a function that calculates the ratio between the sum of the prime numbers lower or equal than x, and the sum of the non-pr...

6 mois il y a

A résolu


Alternate elements!
Write a function that combines two lists by alternating the elements, e.g. ['a','b','c'], ['1','2','3'] → 'a1b2c3'.

6 mois il y a

Charger plus