已解决


How to find the position of an element in a vector without using the find function
Write a function posX=findPosition(x,y) where x is a vector and y is the number that you are searching for. Examples: fin...

6 years 前

已解决


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]

6 years 前

已解决


Is my wife right?
Regardless of input, output the string 'yes'.

6 years 前

已解决


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

6 years 前

已解决


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

6 years 前

已解决


Negative matrix
Change the sign of all elements in given matrix.

6 years 前

已解决


reverse string
input='rama' output='amar'

6 years 前

已解决


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

6 years 前

问题


determine the sum of fraction part for given matrix
determine the sum of fraction part for given matrix a=1.8308 8.9172 6.7537 1.5853 10.2858 5.3804 6.5497 ...

6 years 前 | 2 | 38 个解题者

已解决


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

6 years 前

已解决


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

6 years 前

问题


Minimum Maximum Sort Array
sort one array by put minimum value followed by maximum as follow a=[2 3 1 5] and the solution is y=[1 5 2 3 3 2 5 1];

6 years 前 | 1 | 23 个解题者

已解决


Sum of series III
What is the sum of the following sequence: Σ(2k-1)^3 for k=1...n for different n?

6 years 前

已解决


Sum of series I
What is the sum of the following sequence: Σ(2k-1) for k=1...n for different n?

6 years 前

问题


Zigzag of square matrix
find zigzag of square matrix in one dimension array a=[1 2 3;4 5 6;7 8 9]; should return b= [1 2 4 7 5 3 6 8 9]

6 years 前 | 1 | 18 个解题者

已解决


Add two numbers
Calculate the sum of two numbers. Example input = [2 3] output = 5

6 years 前

已解决


Duplicate each element of a vector.
for an n-dimensional vector x, the function should return another vector 2n-dimension which each element is repeated twice. Ex...

6 years 前

已解决


Find out sum of all elements of given Matrix
Find out sum of all elements of given Matrix A=[1 2 3;4 5 6 ;7 8 9]; Answer must be: 45 *If you like this problem, pl...

6 years 前

已解决


Product of elements in row
Product of matrix such that a=[3 3 1] b=9

6 years 前

已解决


Min of a Matrix
Return the minimum value in the given matrix.

6 years 前

已解决


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

6 years 前

已解决


Unit Matrix
Given n, you should return an n-by-n unit matrix. Example: If input is n=2 then A = [ 1 0 0 1 ] If input ...

6 years 前

已解决


Counting down
Create a vector that counts from 450 to 200 in increments of 10.

6 years 前

已解决


Weighted average
Given two lists of numbers, determine the weighted average. Example [1 2 3] and [10 15 20] should result in 33.333...

6 years 前

已解决


Convert a vector into numbers
Suppose a vector x = [ 1 2 4 7] is given. You have to convert this vector into string number y = '1247'. Examples x = [ 1...

6 years 前

已解决


Flip the bit
Given an input character string (e.g. '1001'), return a character string with the bits flipped ('0110').

6 years 前

已解决


How many digits are there?
Input(s) - any string Output(n) - number of digits within string s

6 years 前

已解决


Back to basics 21 - Matrix replicating
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, generate an output matrix that consists o...

6 years 前

已解决


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

6 years 前

已解决


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

6 years 前

加载更多