A résolu


Find the maximum two numbers of every column of a matrix
Find the maximum two numbers of every column of a matrix. Example: If we input a matrix A = [ 1 2 4 6 0 3 ...

plus de 2 ans il y a

A résolu


Tridiagonal
Return an n-by-n matrix that has a, b, c as the subdiagonal, main diagonal, and superdiagonal entries in the matrix. Example ...

plus de 2 ans il y a

A résolu


Sort numbers by outside digits
Sort the array so that they are sorted as if their value was a 5 digit number made from the first three and last two digits of t...

plus de 2 ans il y a

A résolu


Another colon problem
This is simple problem based on problems 555, 801, 1118, etc. Create an index vector from two input vectors. Example: ...

plus de 2 ans il y a

A résolu


Find the index of n in magic(n)
If input n=5, then magic(n) is 17 24 1 8 15 23 5 7 14 16 4 6 13 20 22...

plus de 2 ans il y a

A résolu


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

plus de 2 ans il y a

A résolu


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

plus de 2 ans il y a

A résolu


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

plus de 2 ans il y a

A résolu


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

plus de 2 ans il y a

A résolu


Splitting Triangle - Problem the second

plus de 2 ans il y a

A résolu


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

plus de 2 ans il y a

A résolu


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

plus de 2 ans il y a

A résolu


Back to basics - mean of corner elements of a matrix
Calculate the mean of corner elements of a matrix. e.g. a=[1 2 3; 4 5 6; 7 8 9;] Mean = (1+3+7+9)/4 = 5

plus de 2 ans il y a

A résolu


Sum of odd numbers in a matrix
Find the sum of all the odd numbers in a matrix. Example x = [2 3 5 7 1 4 11] y = 27

plus de 2 ans il y a

A résolu


Three...is a magic number.
Yes it is... It's a magic number... To help you get rid of that earworm, here's a new Cody problem. You are given a squar...

plus de 2 ans il y a

A résolu


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

plus de 2 ans il y a

A résolu


expand intervals
You're given a row vector of an even number of monotonically increasing integers. Each pair of consecutive integers is the lower...

plus de 2 ans il y a

A résolu


Area of a triangle given its sides

plus de 2 ans il y a

A résolu


UICBioE240 problem 1.6
Find the tangent line of a right triangle given the two of the sides. So if A = [1 1] B = sqrt(2)

plus de 2 ans il y a

A résolu


How to calculate the length of a triangle's side given two angles and one side
You are given a triangle with angles alpha, beta and gamma and sides a opposite alpha, b opposite beta and c opposite gamma. ...

plus de 2 ans il y a

A résolu


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

plus de 2 ans il y a

A résolu


Multiply 2 numbers
Very easy, you just have to multiply 2 numbers but you cannot use the following signs (*, /, - ,^) ,mtimes , times, cross, pro...

plus de 2 ans il y a

A résolu


Generate Square Wave
Generate a square wave of desired length, number of complete cycles and duty cycle. Here, duty cycle is defined as the fraction ...

plus de 2 ans il y a

A résolu


Reference Index Number
Given a reference set R of elements (each unique but identical in type), and a list V of elements drawn from the set R, possibly...

plus de 2 ans il y a

A résolu


Balanced Ternary Numbers: Easy as |, |-, |o
This problem concerns the so-called <http://en.wikipedia.org/wiki/Balanced_ternary balanced ternary> system for representing num...

plus de 2 ans il y a

A résolu


Return a list sorted by number of consecutive occurrences
Inspired by Problem 38 by Cody Team. Given a vector x, return a vector y of the values in x sorted by the number of CONSECUTIVE...

plus de 2 ans il y a

A résolu


Specific Element Count
Given a vector _v_ and a element _e_, return the number of occurrences of _e_ in _v_. Note: NaNs are equal and there may be n...

plus de 2 ans il y a

A résolu


Return unique values without sorting
If the input vector A is [42 1 1], the output value B must be the unique values [42 1] The *values of B are in the s...

plus de 2 ans il y a

A résolu


"Low : High - Low : High - Turn around " -- Create a subindices vector
Let two vectors *lo* and *hi* be given. The job is to create a index vector like so idx = [lo(1):hi(1) lo(2):hi(2) ...]...

plus de 2 ans il y a

A résolu


Return elements unique to either input
Given two numeric inputs a and b, return a row vector that contains the numbers found in only a or only b, but not both. For ex...

plus de 2 ans il y a

Charger plus