Undergraduate student of Electrical and Electronic Engineering at Islamic University of Technology.

Solved

sum of ASCII

Given a string x, return the sum of all ASCII numbers of all characters. for example, if x='lala' ('l'-> 108, 'a'->97) then y...

16 hours ago

Solved

Reduce the logic

We have three logical input, x,y and z. The output is: y = ((x&y)|z)&((z|x&y)|(z&y|x))|((x&z)|z)&((y|x&z)|(z&x|y))|(x|y|z) ...

16 hours ago

Solved

Chicken Race

2 chickens, Pete and Fred, compete in a 100 meter race. Pete runs at a velocity of vp meter/second and Fred is slower, running ...

16 hours ago

Solved

time difference

The arrays x and y contain time values in the form of: x = [hours minutes seconds] Create the output z which contains the...

16 hours ago

Solved

Check capital letters

Check if each first letter of a string is a capital letter. for example: 'This Is Ok' gives a true answer and 'This Is not Ok' ...

16 hours ago

Solved

Binary Inversion

Given the unsigned 8-bit integer x, return the number y which is the binary inversion of x. For example if x is 5, y should b...

1 day 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

1 day 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

1 day ago

Solved

Counting votes

x is a vector of votes, e.g. x=[1 2 3 2 2 1 3 2 1 2 2 2 2], who is the winner? 1,2,3?

1 day ago

Solved

Remove multiples of N

in the vector x remove all multiples of N. x = [1 2 3 4 5 6]; N = 2; Then y = [1 3 5];

2 days ago

Solved

All odd - all even

All odd numbers in x are added, while all even numers are subtracted from this. example: x = [1 2 3 4 5]; y = +(1+3+5)-...

2 days 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

2 days ago

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

2 days ago

Solved

i forgot to use capital I

When referring to yourself you should write "I" (capital) and not "i". So correct the input string x, but be aware that other u...

2 days ago

Solved

Count the numbers

In a array x, count the number of times the number n appears in x. for example: x = [1 2 3 4 3 2 1 2] and n = 2 the answer sh...

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

3 days ago

Solved

Project Euler: Problem 10, Sum of Primes

The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below the input, N. Thank you <http:/...

3 days ago

Solved

Project Euler: Problem 7, Nth prime

By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the Nth prime nu...

3 days ago

Solved

Project Euler: Problem 6, Natural numbers, squares and sums.

The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ...

3 days ago

Solved

Create matrix of replicated elements

Given an input element x, and the dimensions, (m, n) return a matrix of size m x n filled with element x. Example: Input: ...

7 days ago

Solved

Convert a vector into a number

This is a sub problem related to this problem: <http://www.mathworks.com/matlabcentral/cody/problems/621-cryptomath-addition>...

7 days ago

Solved

Filter AC, pass DC

Input x is the sampled signal vector, may have both AC and DC components. Output vector y should not contain any AC component. ...

7 days ago

Solved

Rotate a matrix for 180 degree

Rotate a matrix for 180 degree for eg: x=[1 2 3 4] y=[4 3 2 1]

8 days ago