Solved


Add the even numbers
Add only the even numbers of x example: x = [1 2 3 4 5] the positive numbers are: 2 4, so their sum is 6

mer än 5 år ago

Solved


Simple polynomial evaluation
Compute the value of a polynomial of degree n with all coefficients '1', at value x. n is always n>=0. p(x)=1+x+x^2+...+x^n...

mer än 5 år ago

Solved


Find the sum of the largest two elements in a vector
With this one, you have to find the two largest elements in a vector and output the sum of those numbers.

mer än 5 år ago

Solved


Find max prime number
Given integer number n. Find the max prime number (mpn) that smaller than or equal to n. Example: n = 10 --> mpn = 7

mer än 5 år ago

Solved


Logarithm with base other than 'e'
The standard log() function in Matlab returns the natural logarithm (base equal to Euler's constant). Compute the logarithm for ...

mer än 5 år ago

Solved


Add the odd numbers
Add only the odd numbers of x example: x = [1 2 3 4 5] the positive numbers are: 1 3 5, so their sum is 9

mer än 5 år ago

Solved


Pandigital number n°1 (Inspired by Project Euler 32)
A little warm-up to begin... An n-digit number is pandigital if it makes use of all the digits 1 to n exactly ONCE. For ex...

mer än 5 år ago

Solved


Calculate roots of polynomial given as vector array.
Calculate roots of polynomial given as vector array. Example x=[1 2 0 5 0 3] result=[-2.7267 ; ...

mer än 5 år ago

Solved


Add the positive numbers
Add only the positive numbers of x example: x = [-2 -1 0 1 2 3] the positive numbers are: 1 2 3, so their sum is 6

mer än 5 år ago

Solved


Even or Odd
Write a function which can tell us if the given value x is odd or even. So if x is even return true and if x is odd return false...

mer än 5 år ago

Solved


Average of odd values
Find the average of odd values in given a matrix. e.g x=[ 4 11 8 ; 9 2 7 ] y =( 11 + 9+ 7 ) / 3

mer än 5 år ago

Solved


Matrix element wise multiplication
Take two incoming vectors, and multiply them element wise

mer än 5 år ago

Solved


Check availability of a number in an array
An array is given A=[1 2 3 4 5 7 8 9 10]. Find whether the number n is present in given array or not. If the number n is prese...

mer än 5 år ago

Solved


Geometric Series
Given x and n, give the sum of x ^ 1 to x ^ n. You should not have to use a loop for this.

mer än 5 år ago

Solved


Sum of digits of powers of 2
Given n, first, calculate the number 2^n. Then, sum the digits that comprise that number. For example: Input: n = 7 2^n = ...

mer än 5 år ago

Solved


Percentage profit
If you are buying at x dollar, what will be the selling price for making the r% profit?

mer än 5 år ago

Solved


Reverse digits of a number
Reverse digits of a number. For example, return *321* for the input *123* . The left-hand zeros can be discarded. For exam...

mer än 5 år ago

Solved


Replace Nan!
Replace Nan in the given vector(v) with 9999.

mer än 5 år ago

Solved


determine if
determine if the elements of a matrix is a nan and return true

mer än 5 år ago

Solved


Calculate Simple Intrest for given data
P,N,R stands for Principle amount, No. of years and rate of intrest resp. Calculate intrest I

mer än 5 år ago

Solved


Find the biggest digit in a matrix
Write a function to find the biggest digit in a matrix; input -> a matrix output -> a digit For example; [12; 47;...

mer än 5 år ago

Solved


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

mer än 5 år ago

Solved


Set x value to each even index of vector y.
Set x value to each even index of vector y.

mer än 5 år ago

Solved


Soccer - TOTO
How many different outcomes are there in a soccer-TOTO with n games? For each game there are three results: win - loss - equa...

mer än 5 år ago

Solved


How many rectangles in a grid ?
How many rectangles are there in an m × n grid ? For example, if m=1 & n=2, we have 3 rectangles.

mer än 5 år ago

Solved


Weighted average
Compute the weighted average Y, of the vector A, given the weight vector W. The weighted average is the sum of the dot produc...

mer än 5 år ago

Solved


Sum two matrices
Take two incoming matrices, and sum them

mer än 5 år ago

Solved


Second smallest number
What is the second smallest number in x? example: x = [1 2 3 4 5 6 7 8 9] y = 2

mer än 5 år ago

Solved


Guess
A random number between 1 and 10 is created for the variable y. Guess what its value is.

mer än 5 år ago

Solved


Simple Vector Addition
Take two incoming vectors and output the sum of the two vectors

mer än 5 år ago

Load more