Solved


Five Fingers
A little girl has just learnt how to count from 1 to N using the five fingers of her left hand as follows. She starts by calling...

5 years ago

Solved


Sum the entries of each column of a matrix which satisfy a logical condition.
Given a numeric matrix A and a logical array L of the same size as A, return a row vector S containing the columnwise sums of th...

5 years ago

Solved


Cannibal eating odd and even numbered men
There are N men in a queue. A cannibal eats either all odd-numbered or all even-numbered men in the queue at a time. In the fi...

5 years ago

Solved


Solve The Equation
The coefficients of a system of equations are given in two vectors, x1 and x2. Write a function to solve the equation and return...

5 years ago

Solved


Combination logic
Create an algorithm in MATLAB that calculate the combination for the given positive integers n and k as inputs. When k > n, the ...

5 years ago

Solved


Repeat The Components of Matrix
Repeat The components of a matrix so that the size of the output matrix is double to input matrix and components are repeated ne...

5 years ago

Solved


Can you reshape the matrix?
Given a matrix A, is it possible to reshape it into another matrix with the given number of rows?

5 years ago

Solved


Find unique number in input
Find value that occurs in odd number of input elements.

5 years ago

Solved


Convert from integer to binary
if true % decimalToBinaryVector(x) end

5 years ago

Solved


Find Missing Number
A little problem (inspired by CodeChef) for the coffee break. A friend give you an array of size n-1 integers and these int...

5 years ago

Solved


Additive persistence
Inspired by Problem 2008 created by Ziko. In mathematics, the persistence of a number is the *number of times* one must apply...

5 years ago

Solved


Compound interest - number e
A moneylender wants to receive his annual interest of 12% more frequently. If he receives his interest rate every six months,...

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

5 years ago

Solved


We love vectorized solutions. Problem 1 : remove the row average.
Given a 2-d matrix, remove the row average from each row. Your solution MUST be vectorized. The solution will be tested for ac...

5 years ago

Solved


Piecewise linear interpolation
Given an Mx2 vector and a row of M-1 integers, output a two column vector that linearly interpolates Y times between each succes...

5 years ago

Solved


Calculate time taken by light to reach earth surface
We know the time(seconds) taken by light to reach surface of earth. What if the distance varies yearly or source of light moves ...

5 years ago

Solved


Find argmax of a function
You are given vectors x and y (=f(x)). Return the element of x for which f(x) is maximized.

5 years ago

Solved


Pass the Threshold!!
Write a Matlab function that will take as input a matrix of arbitrary dimensions and a scalar threshold value, and return a vec...

5 years ago

Solved


You never ask a lady her age
Instead you ask her to multiply her age by 10, then subtract any of the first nine multiples of 9 (9,18,...,81), and tell you th...

5 years ago

Solved


Number Power
Raise a number to itself.

5 years ago

Solved


Cube root of max value in a vector
Find the cube root of the maximum value in a vector

5 years ago

Solved


Add consecutive integer numbers
Given consecutive numbers, add the numbers *without using the sum command in MATLAB.*

5 years ago

Solved


Scalar Matrix Manipulation
Assume, input x is a scalar matrix such as, x = 2 0 0 0 2 0 0 0 2 th...

5 years ago

Solved


Find The Difference
Vector x is given.calculate the difference between the biggest and the smallest number that we can create from elements of x. f...

5 years ago

Solved


Angle between two vectors
Given 2 pairs of _cartesian co-ordinates_, determine the angle between the 2 vectors formed by the _points_ and the _origin_. An...

5 years ago

Solved


dễ dàng
cho 2 số. tính tích của chúng

5 years ago

Solved


Chào các bạn.
Cho 3 số. Tính tổng của chúng

5 years ago

Solved


Sum Sum Sum!
Calculate the sum of the natural numbers from 1 to n

5 years ago

Solved


Square
square root of x

5 years ago

Solved


Check prime numbers
Let x, return 1 if x is a prime number, 0 otherwise e.g x = 7, return y =1; x = 6 return y = 0;

5 years ago

Load more