Solved

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

7 months ago

Solved

Sum the Digits of a Number

Given an integer, sum the digits repeatedly until you end up with a single value less than 10. For example, if you add the di...

7 months ago

Solved

Response of First Order Control Systems

In practice, the input signal to an automatic control system is not known ahead of time but usually random in nature. Thus, in t...

7 months ago

Solved

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

7 months ago

Solved

Find Month & day for given day number of a year

Find Month & day for given day number of a year (day number is any number ranging from 1 to 366)

7 months ago

Solved

Determine if input is a valid AHP evaluation matrix

Input is a matrix. Output is a true or false statement (1 or 0). Return true if input is a valid Analytic Hierarchy Process eval...

7 months ago

Solved

Vectorize the digits of an Integer

Create a vector of length N for an integer of N digits. x = 123045; x_vec = [1 2 3 0 4 5]; I happened upon a trick ...

8 months ago

Solved

Remove all the consonants

Remove all the consonants in the given phrase. Example: Input s1 = 'Jack and Jill went up the hill'; Output s2 is 'a ...

8 months ago

Solved

Remove the vowels

Remove all the vowels in the given phrase. Example: Input s1 = 'Jack and Jill went up the hill' Output s2 is 'Jck nd Jll wn...

8 months ago

Solved

is the number happy?

test is a given integer number is Happy of not? answer 1 if yes or 0 is no

8 months ago

Solved

Dudeney Numbers: Numbers which are the cube of their decimal sum

From Wikipedia: _A Dudeney number is a positive integer that is a perfect cube such that the sum of its decimal digits is equa...

8 months ago

Solved

Factorions: Numbers that equal the sum of the factorials of their digits

From Wikipedia: _A factorion is a natural number that equals the sum of the factorials of its decimal digits_ For example: ...

8 months ago

Solved

Find the sines of an isosceles triangle when given its area and height

Find the sines of an isosceles triangle when given its area and height. For example, when A=60 and h=5, the result is [0.3752...

8 months ago

Solved

Max Change in Consecutive Elements

If an array is given as input then find the index of consecutive elements that represent maximum change. Example: Input ...

8 months ago

Solved

SatCom #1: Wavelength of an electomagnetic wave

*Satellite and Space Engineering - Problem #1* _This is the first of a series of problems looking at topics in satellite and ...

8 months ago

Solved

Make an identity matrix whose diagonal elements are 1:n

For a given input n, make an n by n identity matrix that contains the elements 1:n along its diagonal. For example, if input=5: ...

8 months ago

Solved

Reepeating numbers in array

Repeating numbers in array In = [1 0 0 0 2 0 0 0 3 0 0 0 0 0 5 0 0 0 0]. Out = [1 1 1 1 2 2 2 2 3 3 3 3 3 3 5 5 5 5 5].

8 months ago

Solved

How unique?

Sometimes, when we check unique entries of vector we would like to know how many times each value occurs. Given vector of num...

8 months ago

Solved

Largest territory

Determine whose territory is largest. If there are multiple numbers tied for the largest territory, return the smallest number. ...

8 months ago

Solved

Kepler's Equation

Solve <http://en.wikipedia.org/wiki/Kepler's_equation Kepler's Equation>. Note that the solution is rounded down to 5 decima...

8 months ago

Solved

Replace pattern 0 1 0 and 1 0 1

Find and replace a pattern in a row of zeroes and ones. * Find 1 0 1 and replace it with 1 1 1 * Find 0 1 0 and replace it w...

8 months ago

Solved

Time Expansion

How can you slow down any discrete-time signal? Example Input original signal x. x = [1 2 3 -1 -2 -5 -4] We want t...

8 months ago

Solved

Matrix indexing with two vectors of indices

Given a matrix M and two index vectors a and b, return a row vector x where x(i) = M(a(i),b(i)).

8 months ago

Solved

Reindex a vector

You are given two vectors of equal length. Vector N has numeric values (no Inf or NaN) while vector IDX has integers. Place th...

8 months ago

Solved

D'Hondt Method of Proportional-Representation

The D'Hondt method is a proportional representational method for allocating seats to parties in an election. <https://en.wiki...

8 months ago

Solved

~~~~~~~ WAVE ~~~~~~~~~

|The WAVE generator| Once upon a time there was a river. 'Sum' was passing by the river. He saw the water of the river that w...

8 months ago

Solved

expand intervals

You're given a row vector of an even number of monotonically increasing integers. Each pair of consecutive integers is the lower...

8 months ago