Faculty member in civil & environmental engineering

Solved

Ratio between sum of primer numbers 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...

4 hours ago

Solved

Sum of a geometric series

Give the sum of the first 'n' terms of a geometric series, given 'a' as the first term and 'r' as the ratio.

4 hours ago

Solved

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

5 hours ago

Solved

Sort the prime numbers in each row of a 3x3 matrix

Considering a 3x3 matrix A, sort the prime numbers of each row in ascending order. For exemple: input A=[5 8 2 4; ...

5 hours ago

Solved

Determina si el número es primo

Primero, antes que nada: ¿Qué es un número primo? Un número primo es cualquier número que solamente se puede dividir por 1 y ...

5 hours ago

Solved

Divide elements by sum of elements

In this problem, I ask you to write a function which will divide the elements of each column by the sum of the elements of the s...

5 hours ago

Solved

How many jokers?

* Given DNA codes of a group of suspects, * and a code for certain types of jokers, * Count how many jokers of that type. * ...

5 hours ago

Solved

edge detection

write a function that gives the indexes of rising or falling edge x is a vector (assume it contains always at least one eleme...

5 hours ago

Solved

Decrypt Polybius

Decrypt Polybius square. Please refer to <http://www.mathworks.com/matlabcentral/cody/problems/1150-polybius-square Problem 11...

6 hours ago

Solved

Generate Golomb's sequence

Generate Golomb's sequence up to the given number. If n=4, then seq = [1, 2, 2, 3, 3, 4, 4, 4] If n=6, then s...

7 hours ago

Solved

Quote Doubler

Given a string s1, find all occurrences of the single quote character and replace them with two occurrences of the single quote ...

9 hours ago

Solved

Which values occur exactly three times?

Return a list of all values (sorted smallest to largest) that appear exactly three times in the input vector x. So if x = [1 2...

9 hours ago

Solved

Given a 4x4 matrix, swap the two middle columns

If a = [1 2 3 4; 1 2 3 4; 1 2 3 4; 1 2 3 4]; then the result is ans = 1 3 2 4 1 3 2...

11 hours ago

Problem

Evaluate the generalized hypergeometric function

The <https://en.wikipedia.org/wiki/Generalized_hypergeometric_function generalized hypergeometric function> is defined as <<...

12 hours ago | 0

Solved

Duplicate a character

Duplicate a character 'n' times. Example 1: str='a' n=5 output='aaaaa' Example 2: str='*' n=3 output='***'

15 hours ago

Solved

Sum the squares of numbers from 1 to n

For a given value of n return the sum of square of numbers from 1 to n. Example For n = 2 then sum of squares = 5 (1^2 + ...

15 hours ago

Solved

Matlab Basics - Assigning Variables

Assign different types of data to variables: integer, double, and strings Example: A is a double, for example 2.34 B is a...

16 hours ago

Solved

Sum the real and imaginary parts of a complex number

Sum the real and imaginary parts of a complex number. Example c = 1+2i has the solution 1 + 2 = 3

16 hours ago

Solved

Find the biggest empty box

You are given a matrix that contains only ones and zeros. Think of the ones as columns in an otherwise empty floor plan. You wan...

19 hours ago

Solved

Determine whether a given point is inside or outside a polygon

A closed polygon may be described by an N x 2 array of nodes, where the last node and the first node are the same. Each row of ...

20 hours ago

Problem

Solve a Weird Calculator puzzle

The September 2012 issue of GAMES Magazine had a Weird Calculator puzzle by Erich Friedman. In this puzzle, the calculator has o...

21 hours ago | 0

Solved

A different counting method

Given an array (x) of integers, the "counting" array (y) is showing the number of identical consecutive integers in x in front o...

1 day ago

Solved

Equation Times (of the day)

Many times throughout the day can represent mathematical equations. In this problem, we focus on times that include the four bas...

1 day ago

Solved

Find out the Gray Code for a Given Binary Number

Find out <http://en.wikipedia.org/wiki/Gray_code Gray Code> for a given binary number Example Binary input 1000 Gray ...

1 day ago

Solved

Binary

Given a positive, integer n, create a function that returns the respective binary number in the form of a vector. Example: ...

1 day ago

Solved

multiple of nine?

Given a positive number n, return true if n is a multiple of 9 and false if not. Do not make the division and do not use functio...

2 days ago

Solved

Replace Negative(-) by 0 and positive by 1

In a given Matrix Replace all element having *Negative sign with 0* and *Positive elements with 1* .

2 days ago

Problem

Count alternating permutations

In an alternating permutation of numbers 1 to n, the numbers are arranged so that they alternately increase and decrease. For ex...

2 days ago | 0

Solved

Fermat's last theorem - again

For a given integer n, express it as a sum of two squares if possible. Return empty matrix otherwise. Solution may not be unique...

2 days ago

Solved

Square Diagonal

If n is the given number, then make a diagonal matrix of size 2*2 with the square of that number.

2 days ago