Gelöst


Word Counting and Indexing
You are given a list of strings, each being a list of words divided by spaces. Break the strings into words, then return a maste...

etwa 14 Jahre vor

Gelöst


Use of regexp
* Given a string, containing several sentences, such as: * 'I played piano. John played football. Anita went home. Are you safe...

etwa 14 Jahre vor

Gelöst


More luck than brains
Give a random function that guess and return numbers from 1 to 6 exactly like the test suite .

etwa 14 Jahre vor

Gelöst


peta to nano (x-ray)
for certain x-ray radiation, given frequency in petahertz, give wavelength in nanometer, must be accurate +/- 25%

etwa 14 Jahre vor

Gelöst


First non-zero element in each column
For a given matrix, calculate the index of the first non-zero element in each column. Assuming a column with all elements zero ...

etwa 14 Jahre vor

Gelöst


Matrix indexing with two vectors of indices
Given a matrix M and two index vectors a and b, return a row vector x where x(i) = M(a(i),b(i)).

etwa 14 Jahre vor

Gelöst


Create One Large Eye of size N x N Quickly?
*<http://en.wikipedia.org/wiki/Aye_(yes) Aye !!!>*

etwa 14 Jahre vor

Gelöst


Implement a counter
Write a function that returns a function that counts the number of times it is invoked. Example: >> h = counter; >> h() ...

etwa 14 Jahre vor

Gelöst


Spiral In
Create an m by n matrix filled with sequential integers starting from 1 and arranged in a counterclockwise spiral that hugs the ...

etwa 14 Jahre vor

Gelöst


Function composition
Write a function that accepts two function handles f and g and returns the composition h. That is, h = (f o g)(x) = f(g(x)) ...

etwa 14 Jahre vor

Gelöst


middleAsColumn: Return all but first and last element as a column vector
Given input A, return all but the first and last elements, arranged as a column vector. (I.e., all dimensions after the first s...

etwa 14 Jahre vor

Gelöst


Convert Hard Drive marketing sizes to actual data sizes
Hard drive sizes are typically marketed using the decimal meaning of prefixes, whereas RAM uses binary meanings. For example: ...

etwa 14 Jahre vor

Gelöst


Create a square matrix of multiples
Given an input, N, output a matrix N x N with each row containing multiples of the first element of each row. This also applies...

etwa 14 Jahre vor

Gelöst


Triangle Numbers Below N
This is an offshoot of <http://www.mathworks.com/matlabcentral/cody/problems/5-triangle-numbers Cody Problem 5: Triangle Numbers...

etwa 14 Jahre vor

Gelöst


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

etwa 14 Jahre vor

Gelöst


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

etwa 14 Jahre vor

Gelöst


commutative?
Given the handle to a binary function that takes two ordinary numbers, test if the function is commutative.

etwa 14 Jahre vor

Gelöst


Number of Circles in a Number
Given a number, return the number of closed 'circles' in the base 10 numerical representation. Note: the number 4 has no circ...

etwa 14 Jahre vor

Gelöst


Filter values in a vector
Cody often benefits from a functional style of programming. For example, your score is often better when you compose multiple fu...

etwa 14 Jahre vor

Gelöst


Vectorizing, too easy or too hard?
Please insert a . before any ^, * or / in the string. That's it!!

etwa 14 Jahre vor

Gelöst


Find perfect placement of non-rotating dominoes (easier)
Given a list of ordered pairs, find the order they should be placed in a line, such that the sum of the absolute values of the d...

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

etwa 14 Jahre vor

Gelöst


Number of 1s in a binary string
Find the number of 1s in the given binary string. Example. If the input string is '1100101', the output is 4. If the input stri...

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

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

etwa 14 Jahre vor

Gelöst


Is the Point in a Triangle?
Check whether a point or multiple points is/are in a triangle with three corners Points = [x, y]; Triangle = [x1, y1; x...

etwa 14 Jahre vor

Gelöst


Flip the main diagonal of a matrix
Given a n x n matrix, M, flip its main diagonal. Example: >> M=magic(5); >> flipDiagonal(M) 9 24 1 ...

etwa 14 Jahre vor

Gelöst


Sum of first n terms of a harmonic progression
Given inputs a, d and n, return the sum of the first n terms of the harmonic progression a, a/(1+d), a/(1+2d), a/(1+3d),....

etwa 14 Jahre vor

Gelöst


Set defaults
Write a function that computes the volume of a cube. The function should be able to accept three inputs: the length, width, and...

etwa 14 Jahre vor

Frage


Compute cumulative sum of a column vector without for loop
*For each index of a column vector , I want to compute the sum from |index| to |index+spacing|*. spacing is an integer. My a...

etwa 14 Jahre vor | 2 Antworten | 0

2

Antworten

Mehr laden