解決済み

Swap the first and last columns

Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...

3ヶ月 前

解決済み

Swap the input arguments

Write a two-input, two-output function that swaps its two input arguments. For example: [q,r] = swap(5,10) returns q = ...

3ヶ月 前

解決済み

Column Removal

Remove the nth column from input matrix A and return the resulting matrix in output B. So if A = [1 2 3; 4 5 6]; ...

3ヶ月 前

解決済み

Reverse the vector

Reverse the vector elements. Example: Input x = [1,2,3,4,5,6,7,8,9] Output y = [9,8,7,6,5,4,3,2,1]

3ヶ月 前

解決済み

Select every other element of a vector

Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

3ヶ月 前

解決済み

Length of the hypotenuse

Given short sides of lengths a and b, calculate the length c of the hypotenuse of the right-angled triangle. <<https://i.imgu...

3ヶ月 前

解決済み

Triangle Numbers

Triangle numbers are the sums of successive integers. So 6 is a triangle number because 6 = 1 + 2 + 3 which can be displa...

3ヶ月 前

解決済み

Generate a vector like 1,2,2,3,3,3,4,4,4,4

Generate a vector like 1,2,2,3,3,3,4,4,4,4 So if n = 3, then return [1 2 2 3 3 3] And if n = 5, then return [1 2 2...

3ヶ月 前

解決済み

Make the vector [1 2 3 4 5 6 7 8 9 10]

In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

3ヶ月 前

解決済み

Maximum value in a matrix

Find the maximum value in the given matrix. For example, if A = [1 2 3; 4 7 8; 0 9 1]; then the answer is 9.

3ヶ月 前

解決済み

Find the sum of all the numbers of the input vector

Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

3ヶ月 前

解決済み

Compress strings (not springs)

Please remove excess space, limit one space between others, and no space before punctuation marks. * For example, 'Trendy , ...

3ヶ月 前

解決済み

Bang Bang in Bangalore

Imagine a strange language disorder, Bangolangosis, has developed among trigonometricians of <http://en.wikipedia.org/wiki/Banga...

3ヶ月 前

解決済み

Formatting currency numbers

Given a number, format it properly for textual display using the notation $xxx,xxx,xxx.xx. Assume that no more than two digits ...

3ヶ月 前

解決済み

English to Pig Latin Translator

Pig latin is a faux-language based off of English. The rules are as follows (excerpted from the wikipedia entry for Pig Latin): ...

3ヶ月 前

解決済み

Pig Latin to English Translator

Pig latin is a faux-language based off of English. The rules are as follows (excerpted from the <http://en.wikipedia.org/wiki/Pi...

3ヶ月 前

解決済み

Use of regexp

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

3ヶ月 前

解決済み

Transposition as a CIPHER

This all about transcripting a text message. If the input string is: *s1 = 'My name is Sourav Mondal'*, then the output is: *s2...

3ヶ月 前

解決済み

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

3ヶ月 前

解決済み

String substitution, sub problem to cryptoMath

This is a sub problem related to this problem: <http://www.mathworks.com/matlabcentral/cody/problems/621-cryptomath-addition>...

3ヶ月 前

解決済み

Pizza!

Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.] Non-scor...

3ヶ月 前

解決済み

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

3ヶ月 前

解決済み

Find mistyped words in text (mixed-up letters)

Mistyped words are a regular occurrence in emails, texts, status updates, and the like. Many times, people send or post a second...

4ヶ月 前

解決済み

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

4ヶ月 前

解決済み

Calculate a modified Levenshtein distance between two strings

Inspired by the Cody problem found <http://www.mathworks.com/matlabcentral/cody/problems/93-calculate-the-levenshtein-distance-b...

5ヶ月 前

解決済み

Calculate the Levenshtein distance between two strings

This problem description is lifted from <http://en.wikipedia.org/wiki/Levenshtein_distance>. The Levenshtein distance betwee...

5ヶ月 前

解決済み

QWERTY Shift Code Decoder

Decode a string encoded using the QWERTY shift code. QWERTY shift code is where the message was touch typed but with an offse...

5ヶ月 前

解決済み

QWERTY Shift Encoder

Encode a string using the QWERTY shift code. This code is where you touch type but are offset by one character to the right. ...

5ヶ月 前