Gelöst


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

mehr als 13 Jahre vor

Gelöst


First N Perfect Squares
*Description* Return the first N perfect squares *Example* input = 4; output = [ 1 4 9 16 ];

mehr als 13 Jahre vor

Gelöst


Right and wrong
Given a vector of lengths [a b c], determines whether a triangle with those sides lengths is a right triangle: <http://en.wikipe...

mehr als 13 Jahre vor

Gelöst


inner product of two vectors
inner product of two vectors

mehr als 13 Jahre vor

Gelöst


radius of a spherical planet
you just measured its surface area, that is the input.

mehr als 13 Jahre vor

Gelöst


Check if sorted
Check if sorted. Example: Input x = [1 2 0] Output y is 0

mehr als 13 Jahre vor

Gelöst


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

mehr als 13 Jahre vor

Gelöst


Pangrams!
A pangram, or holoalphabetic sentence, is a sentence using every letter of the alphabet at least once. Example: Input s ...

mehr als 13 Jahre vor

Gelöst


Find the alphabetic word product
If the input string s is a word like 'hello', then the output word product p is a number based on the correspondence a=1, b=2, ....

mehr als 13 Jahre vor

Gelöst


Rotate and display numbered tile
Imagine a square tile with four numbers on it, one on each edge. We will call these edges north, east, south, and west. If th...

mehr als 13 Jahre vor

Gelöst


Scoring for oriented dominoes
Given a list of ordered pairs, and the order they should be placed in a line, find the sum of the absolute values of the differe...

mehr als 13 Jahre vor

Gelöst


Stuff the Board
You have a stack of tiles to put onto an array-like playing board. Each tile has a number (always an integer), and the board var...

mehr als 13 Jahre vor

Gelöst


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

mehr als 13 Jahre vor

Gelöst


Finding Perfect Squares
Given a vector of numbers, return true if one of the numbers is a square of one of the other numbers. Otherwise return false. E...

mehr als 13 Jahre vor

Gelöst


Balanced number
Given a positive integer find whether it is a balanced number. For a balanced number the sum of first half of digits is equal to...

mehr als 13 Jahre vor

Gelöst


Which values occur exactly three times?
Return a list of all values (sorted smallest to largest) that appear exactly three times in the input vector x. So if x = [1 2...

mehr als 13 Jahre vor

Gelöst


Target sorting
Sort the given list of numbers |a| according to how far away each element is from the target value |t|. The result should return...

mehr als 13 Jahre vor

Gelöst


Who Has the Most Change?
You have a matrix for which each row is a person and the columns represent the number of quarters, nickels, dimes, and pennies t...

mehr als 13 Jahre vor

Gelöst


Remove the vowels
Remove all the vowels in the given phrase. Example: Input s1 = 'Jack and Jill went up the hill' Output s2 is 'Jck nd Jll wn...

mehr als 13 Jahre vor

Gelöst


Given a window, how many subsets of a vector sum positive
Given a vector: [1 0 -1 3 2 -3 1] and a window of 2, A sliding window would find: 1 + 0 = 1 0 - 1 = -1 ...

mehr als 13 Jahre vor

Gelöst


Make a run-length companion vector
Given a vector x, return a vector r that indicates the run length of any value in x. Each element in r shows how many times the ...

mehr als 13 Jahre vor

Gelöst


Implement simple rotation cypher
If given a letter from the set: [abc...xyz] and a shift, implement a shift cypher. Example: 'abc' with a shi...

mehr als 13 Jahre vor

Gelöst


Create times-tables
At one time or another, we all had to memorize boring times tables. 5 times 5 is 25. 5 times 6 is 30. 12 times 12 is way more th...

mehr als 13 Jahre vor

Gelöst


Arrange vector in ascending order
Arrange a given vector in ascending order. input = [4 5 1 2 9]; output = [1 2 4 5 9];

mehr als 13 Jahre vor

Gelöst


No Twins?
Write a function that accepts as input a vector and returns the same vector, but retaining only the first occurrence of an eleme...

mehr als 13 Jahre vor

Gelöst


Back to basics 15 - classes
Covering some basic topics I haven't seen elsewhere on Cody. Return the class of the input variable.

mehr als 13 Jahre vor

Gelöst


Distance walked 2D
Suppose you go from x-y coordinates [3,4] to [0,0] to [0,1] to [1,1], then you walked 7 units of distance.

mehr als 13 Jahre vor

Gelöst


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

mehr als 13 Jahre vor

Gelöst


Determine Whether an array is empty
Input a matrix x, output y is TRUE if x is empty, otherwise FALSE.

mehr als 13 Jahre vor

Gelöst


Get the length of a given vector
Given a vector x, the output y should equal the length of x.

mehr als 13 Jahre vor

Mehr laden