Solved

Replace Nonzero Numbers with 1

Given the matrix x, return the matrix y with non zero elements replaced with 1. Example: Input x = [ 1 2 0 0 0 ...

10 maanden ago

Solved

What's the missing interior angle?

I'm talking about polygons... The sum of the interior angles of a triangle is 180 degrees. The sum of the interior angles of a...

10 maanden ago

Solved

Give prime Numbers upto n

You are given a input number x; print all the prime numbers less than equal to x.

10 maanden ago

Solved

Find the sum of n squares

What is the sum of the squares of the first n integers?

10 maanden ago

Solved

Is it column vector?

Is it column vector? Check vector for column vector without using iscolumn function.

10 maanden ago

Solved

find the relation...

if given input is 1, output is 4. if input is 55, output is 3136.

10 maanden ago

Solved

Generate the sum of Squares of the given number

|P(n) = 1^2 + 2^2 + ... + n^2| |P(1) = 1| |P(2) = 1 + 4 = 5;| |P(3) = 5 + 9 = 14;| |P(4) = 14 + 16 = 30;|

10 maanden ago

Solved

Create a Standard Size Vector

Given an input x, create a row vector y from 1 to x with 5 elements.

10 maanden ago

Solved

Crate a vector of logarithmically spaced

Create a vector of logarithmically spaced from 10^0 to 10^x with n sample Example: if x=4 and n=3 Answer must be=[1 100 10...

10 maanden ago

Solved

If you have matrix A, create matrix B using matrix A as an "element"

A = [1 2 3 4; 5 6 7 8] B = [1 2 3 4 1 2 3 4; 5 6 ...

10 maanden ago

Solved

Bit calculation

Give me the count of numbers from 1 to n having their last two bits as 0. For example function y = ret_count(4) y = x...

10 maanden ago

Solved

Prime number removal

remove all prime numbers from the input e.g. input = 1 2 3 4 5 6 7 8 9 10 11 12 ...

10 maanden ago

Solved

Leap Year

According to Gregorian Calender(which is in use now, in many countries),decide whether a given year is a leap year or not. Give...

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

10 maanden ago

Solved

Find elements of set A those are not in set B

Given two sets of data A and B. Find elements of A those are not in set B. ...

10 maanden ago

Solved

The Goldbach Conjecture, Part 2

The <http://en.wikipedia.org/wiki/Goldbach's_conjecture Goldbach conjecture> asserts that every even integer greater than 2 can ...

10 maanden ago

Solved

The Goldbach Conjecture

The <http://en.wikipedia.org/wiki/Goldbach's_conjecture Goldbach conjecture> asserts that every even integer greater than 2 can ...

10 maanden ago

Solved

Find common elements in matrix rows

Given a matrix, find all elements that exist in every row. For example, given A = 1 2 3 5 9 2 5 9 3 2 5 9 ...

10 maanden ago

Solved

Bell Number calculator

Calculate a vector of Bell numbers for sets up to length n. Bell numbers are the maximum number of partitions of a set. See the ...

10 maanden ago

Solved

N-th Odious

Given index n return n-th <https://oeis.org/A000069 odious number>.

10 maanden ago

Solved

Triangle Numbers

Triangle numbers are the sums of successive integers. So 6 is a triangle number because 6 = 1 + 2 + 3 which can be displa...

10 maanden ago

Solved

Find the elements of a matrix according to a defined property.

From A = [5,2,3] and B = [1,2,3,4,5,6,7,8,9,10] produce a vector C where : C(1) is the sum of the first A(1) elements of B, ...

10 maanden ago

Solved

Cell joiner

You are given a cell array of strings and a string delimiter. You need to produce one string which is composed of each string fr...

10 maanden ago

Solved

Make one big string out of two smaller strings

If you have two small strings, like 'a' and 'b', return them put together like 'ab'. 'a' and 'b' => 'ab' For extra ...

10 maanden ago

Solved

Tell me the slope

Tell me the slope, given a vector with horizontal run first and vertical rise next. Example input: x = [10 2];

10 maanden ago

Solved

Sorted highest to lowest?

Return 1 if the input is sorted from highest to lowest, 0 if not. Example: 1:7 -> 0 [7 5 2] -> 1

10 maanden ago