A résolu


Create a cell array out of a struct
Create a cell array out of a (single) struct with the fieldname in the first column and the value in the second column: in: ...

presque 6 ans il y a

A résolu


Find the Oldest Person in a Room
Given two input vectors: * |name| - user last names * |age| - corresponding age of the person Return the name of the ol...

presque 6 ans il y a

A résolu


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

presque 6 ans il y a

A résolu


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

presque 6 ans il y a

A résolu


Distance walked 1D
Suppose you go from position 7 to 10 to 6 to 4. Then you have walked 9 units of distance, since 7 to 10 is 3 units, 10 to 6 is 4...

presque 6 ans il y a

A résolu


Column norms of a matrix
Given a matrix M, return a vector y such that for each k y(k)=norm(M(:,k)) (y(k) is the Euclidean norm of the k-th col...

presque 6 ans il y a

A résolu


Interpolator
You have a two vectors, a and b. They are monotonic and the same length. Given a value, va, where va is between a(1) and a(end...

presque 6 ans il y a

A résolu


Convert a structure into a string
Convert the contents of each fields into a string. Example with an input structure s with 2 fields : s.age = '33' s....

presque 6 ans il y a

A résolu


Find Rotated Substring
Given a string s1, find if a rotated version of s1 is present in a second string s2. For example, rotated version of some str...

environ 6 ans il y a

A résolu


letter yes yes & letter no no
Split a string into two strings, wherein the first string has all alphabetic letters and the second string has all the remaining...

environ 6 ans il y a

A résolu


Simple equation: Annual salary
Given an hourly wage, compute an annual salary by multiplying the wage times 40 and times 50, because salary = wage x 40 hours/w...

environ 6 ans il y a

A résolu


Return the largest number that is adjacent to a zero
This example comes from Steve Eddins' blog: <http://blogs.mathworks.com/steve/2009/05/27/learning-lessons-from-a-one-liner/ Lear...

environ 6 ans il y a

A résolu


Pascal's Triangle
Given an integer n >= 0, generate the length n+1 row vector representing the n-th row of <http://en.wikipedia.org/wiki/Pascals_t...

environ 6 ans il y a

A résolu


Calculate the Hamming distance between two strings
Inspired by a similar Cody problem found <http://www.mathworks.com/matlabcentral/cody/problems/93-calculate-the-levenshtein-dist...

environ 6 ans il y a

A résolu


Without the French accent please!
Suppress the French accent. Example 'Déjà présent' -> 'Deja present'

environ 6 ans il y a

A résolu


Add more zeros
Find code that adds one 0 to each sequence of 0 in a string (composed with only 0 or 1). For example: '1010' -> '100100' ...

environ 6 ans il y a

A résolu


Split a string into chunks of specified length
Given a string and a vector of integers, break the string into chunks whose lengths are given by the elements of the vector. Ex...

environ 6 ans il y a

A résolu


Cell Counting: How Many Draws?
You are given a cell array containing information about a number of soccer games. Each cell contains one of the following: * ...

environ 6 ans il y a

A résolu


Guess Cipher
Guess the formula to transform strings as follows: 'Hello World!' --> 'Ifmmp Xpsme!' 'Can I help you?' --> 'Dbo J ifmq zpv...

environ 6 ans il y a

A résolu


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

environ 6 ans il y a

A résolu


Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1. Hint: use increment.

environ 6 ans il y a

A résolu


Doubling elements in a vector
Given the vector A, return B in which all numbers in A are doubling. So for: A = [ 1 5 8 ] then B = [ 1 1 5 ...

environ 6 ans il y a

A résolu


Create a vector
Create a vector from 0 to n by intervals of 2.

environ 6 ans il y a

A résolu


Flip the vector from right to left
Flip the vector from right to left. Examples x=[1:5], then y=[5 4 3 2 1] x=[1 4 6], then y=[6 4 1]; Request not ...

environ 6 ans il y a

A résolu


Whether the input is vector?
Given the input x, return 1 if x is vector or else 0.

environ 6 ans il y a

A résolu


Find max
Find the maximum value of a given vector or matrix.

environ 6 ans il y a

A résolu


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

environ 6 ans il y a

A résolu


Inner product of two vectors
Find the inner product of two vectors.

environ 6 ans il y a

A résolu


Arrange Vector in descending order
If x=[0,3,4,2,1] then y=[4,3,2,1,0]

environ 6 ans il y a

A résolu


Magic is simple (for beginners)
Determine for a magic square of order n, the magic sum m. For example m=15 for a magic square of order 3.

environ 6 ans il y a

Charger plus