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

6 years ago

Solved


Optimization of cylinder surface area
Optimization of a cylinder surface area. What are the best parameters (radius and height) to get the minimum cylinder surface a...

6 years ago

Solved


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

6 years ago

Solved


Double the next!
Given two numbers, m and n, find a matrix m x n where each element value is twice the value of the previous element. Starting fr...

6 years ago

Solved


Get the value 100
Knowing that 123-45-67+89=100, write a function that gives this result for any order of the digits in the input. Otherwise, the ...

6 years ago

Solved


Check if is a square
Given four coordinates, write a function to check if they form a square on the XY plane.

6 years ago

Solved


Perimeter
Given a sequence of points forming a closed path (first and last points are coincident) return the perimeter value. For example...

6 years ago

Solved


Detect a number and replace with two NaN's
Write code which replaces the number 1 with two NaNs. Example X = [ 1 2 NaN 4 1 3 7 NaN 1 4 NaN 2] ...

6 years ago

Solved


Create the flag of Ramumbia
The little known nation of Ramumbia has a very simple flag. It is made up of vertical stripes, Red, Green, Blue, that are equall...

6 years ago

Solved


Zero
given an integer a, find the smallest possible integer b(b>0) such that their bitwise logical AND is zero. * if a=11(1011) t...

6 years ago

Solved


Calculate correlation.
There are two data. y1=[0 1 2 3 4]' y2=[2 3 4 5 6]' We can see positive relationship between y1 and y2. The relations...

6 years ago

Solved


Find the repeating elements and repetitions of a row vector.
So let's say that x is a vector, for example, x = [4, 4, 5, 5, 5, 6, 7, 7,8, 8, 8, 8] Now we want to get the following two ve...

6 years ago

Solved


Find a common edge
First input is T, a triplet list of indices. Second input is e = [e1 e2], a row vector, couple of indices (positive distinct int...

6 years ago

Solved


Find the longest sequence of 1's in a binary sequence.
Given a string such as s = '011110010000000100010111' find the length of the longest string of consecutive 1's. In this examp...

6 years ago

Solved


Funny problems
Generate the following vector: if n=1 then q=1; elseif n=2 then q=[2 2 1]; elseif n=3 then q=[3 3 3 2 2 1]; ... end

6 years ago

Solved


Find a common vertex
First input is T, a triplet list of indices. Second input is i, a single index (positive integer). The goal of this function is ...

6 years 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].

6 years ago

Solved


Convert Fahrenheit to Kelvin
Convert the value f in Fahrenheit to Kelvin

6 years ago

Solved


How to find the position of an element in a vector without using the find function
Write a function posX=findPosition(x,y) where x is a vector and y is the number that you are searching for.

6 years ago

Solved


Check if integer is a prime number
Check if integer i is a prime number. Returns logical true '1' if it is.

6 years ago

Solved


Powers Of
Fill the vector with powers of 2, so that vector(1) is 2^1, vector(2) is 2^2, etc. Stop with vector(10). Complete the function ...

6 years ago

Solved


Matrix operation

6 years ago

Solved


Swap

6 years ago

Solved


String count
given a string 'str', count the number of the followings - * letters * digits * white space * capital letters * smal...

6 years ago

Solved


Find the sequence
Find the nth number of a sequence. Check the test suite to determine the sequence. * hint: it is closely related to familiar ...

6 years ago

Solved


Find the centroid of triangle
Imagine that you want to calculate the *centroid* of some _triangles_ given in matrix form. First the coordinates of the vertice...

6 years ago

Solved


How many Christmas presents under the tree?
For many families at Christmas, each family member gives 1 present to every other family member. The main exception is that chil...

6 years ago

Solved


Matrix multiplication across rows
Given matrix m, return matrix n such that, rows of n are result of multiplication of the rows of the input matrix Example ...

6 years ago

Solved


Tribonacci Sequence
Generate the tribonacci sequence upto n

6 years ago

Solved


$10,000 sequence
Find the nth term of the Hofstadter–Conway sequence and its chaotic cousin. <https://en.wikipedia.org/wiki/Hofstadter_sequenc...

6 years ago

Load more