Solved


expand intervals vol.2
Similar to problem <http://www.mathworks.co.uk/matlabcentral/cody/problems/2528 2528>. This is a more general case, when bounds ...

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

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

6 years ago

Solved


Generate the Matrix!
Given n, generate the following matrix: a = [ n n-1 n-2 ... 2 1; n-1 n-1 n-2 ... 2 1; n-2 n-2 n-2 ... 2 1;...

6 years ago

Solved


Replace values under a limit
For a vector x and number n, the goal is to find every element of x inferior to n and replace it by n. Example x= [ 1 2 3...

6 years ago

Solved


Count number of words in string
Count number of words in string Examples 'hi', answer is 1 'hi hi', answer is 2 'I enjoy cody', answer is 3

6 years ago

Solved


Narcissistic problem
How many likes has this problem?

6 years ago

Solved


Sideways sum
Given natural number calculate its _population count_.

6 years ago

Solved


pressure to dB?
given x ratio of pressure, find corresponding y dB

6 years ago

Solved


Determine digits of the Copeland-Erdos constant
<https://www.mathworks.com/matlabcentral/cody/problems/1477-champernowne-constant/solutions/new Cody Problem 1477> asks us to de...

6 years ago

Solved


Fill an array given a sum and array length values
Fill an array with random numbers so that their sum and array length will be equal to the given values as input. Function will ...

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

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

6 years ago

Solved


counting groups!
This problem is about counting groups. Example If you have x: x = [0.8 0.8 0.8 0.3 0.3 0.4 0.5 0.6 0.6 0.9] then a...

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

6 years ago

Solved


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

6 years ago

Solved


Simpsons's rule (but not Homer Simpson)
I wonder what Homer Simpson would have thought of Simpson's rule? Somehow I doubt his thoughts would have included the phrase Ne...

6 years ago

Solved


Create tangent function out of sine function only
Please don't use cosine and tangent functions

6 years ago

Solved


Avengers Assemble!
Given matrix with so many zeroes, trim those zeroes and output a matrix joining all nnz elements Example: input = [0 0 0 0 0...

6 years ago

Solved


Create cosine function out of sine
Please dont use cos(x) directly

6 years ago

Solved


Grazing-01
A cow is tied to an outside corner of a rectangular barn of size (a,b) with a rope of length l. What is the maximum area the cow...

6 years ago

Solved


Take it out
Consider the integer number sequence N (1 to infinity). After each iteration, take out the (k+1)th elements; where k is the n...

6 years ago

Solved


The Tortoise and the Hare - 01
Suppose in an infinitely long line, the hare is standing in position 0. From that place, it can jump either in the +ve direct...

6 years ago

Problem


Construct a prime circle
A <https://mathworld.wolfram.com/PrimeCircle.html prime circle> is a circular arrangement of the numbers 1 to 2n such that pairs...

6 years ago | 7 | 53 solvers

Solved


Replace 0 to NaN!
In given matrix A=[1 nan nan; 2 2 nan; nan nan 1]; replace NaN to 0. Use matrix A as a input.

6 years ago

Solved


Orthogonal lines
Check whether two given lines are orthogonal or not. Two lines are orthogonal if they create a right angle at their intersect...

6 years ago

Solved


remove numbers from a string
check the given string for any numbers.in case one is found,remove it.but the two portions should be separated. if more than one...

6 years ago

Solved


remove single elements
Given a vector of integers, remove the elements that have appeared only once. The output elements should be in exact order as th...

6 years ago

Solved


Find the area of a rectangle if length of the diagonal is given.
if length of a diagnonal in rectangle is 5. Its area is 12.

6 years ago

Solved


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

6 years ago

Load more