A résolu


Generate the sum of Squares of the given number
|P(n) = 1^2 + 2^2 + ... + n^2| |P(1) = 1| |P(2) = 1 + 4 = 5;| |P(3) = 5 + 9 = 14;| |P(4) = 14 + 16 = 30;|

plus de 10 ans il y a

A résolu


Is It a Snake?
Given an m-by-n matrix, return true if the elements of the matrix are a connected "snake" shape from 1 to m*n. Otherwise return ...

plus de 10 ans il y a

A résolu


prime to each other
Given two integers n1, n2 greater than 1, find out if they have common divisors or are prime to each other. Return "true" if the...

plus de 10 ans il y a

A résolu


multiple of nine?
Given a positive number n, return true if n is a multiple of 9 and false if not. Do not make the division and do not use functio...

plus de 10 ans il y a

A résolu


Find elements of set A those are not in set B
Given two sets of data A and B. Find elements of A those are not in set B. ...

plus de 10 ans il y a

A résolu


Why the heck are they blinking!?!?
Merry Christmas everyone! Sadly, the lights you've had on your tree for so many years burned out, and it's time to get a new se...

plus de 10 ans il y a

A résolu


sparse_matrix
You convert a vector to a sparse matrix. for example *x* =[1 2 3]; output will be *y* = [1 0 0 ...

plus de 10 ans il y a

A résolu


Distance a ball travels after throwing vertically
Calculate the total distance *'d'* (in meters) a ball would travel after *'s'* seconds and starting velocity of *'v'* (in m/s). ...

plus de 10 ans il y a

A résolu


Matrix of almost all zeros, except for main diagonal
Write a program to input an integer n and build a n-by-n matrix with the numbers 1,2,...,n on the main diagonal and zeros elsewh...

plus de 10 ans il y a

A résolu


What's the missing interior angle?
I'm talking about polygons... The sum of the interior angles of a triangle is 180 degrees. The sum of the interior angles of a...

plus de 10 ans il y a

A résolu


Determine the full width at half max
Determine the full width at half max of a curve. The full width at half maximum (FWHM) is a parameter which is used for desc...

plus de 10 ans il y a

A résolu


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

plus de 10 ans il y a

A résolu


Smith numbers
Return true if the input is a Smith number in base ten. Otherwise, return false. Read about Smith numbers at <http://en.wikipedi...

plus de 10 ans il y a

A résolu


Histogram of histogram
Histogram of histogram (HoH) is a useful measure concerning the distribution of random data, which has diverse applications in d...

plus de 10 ans il y a

A résolu


Can you reshape the matrix?
Given a matrix A, is it possible to reshape it into another matrix with the given number of rows?

plus de 10 ans il y a

A résolu


Longest Collatz Sequence
Inspired by Projet Euler n°14. The Collatz iterative sequence (See Cody problem n° 2103 and 211) is defined for the set of po...

plus de 10 ans il y a

A résolu


Get all corner elements from a matrix where dimension of matrix is always equal to or greater than 2.
if a given matrix a = [1 2 3;4 5 6]; so answer is going to be [1 3;4 6]

plus de 10 ans il y a

A résolu


sort matrix
Given a matrix, sort it for each column, but cannot change the element of each row. for example input = [1 3; 2 4;1 5;3 6]; ...

plus de 10 ans il y a

A résolu


Test Problem; Create a 5x5 array containing all ones
This is a test for learning the process of creating a Cody problem. The goal of this test problem will be to create an array,...

plus de 10 ans il y a

A résolu


Sum my indices
Given inputs M and N (in that order), output an MxN matrix whose entries are equal to the sum of their indices. Example input...

plus de 10 ans il y a

A résolu


Find the Final State of an Abelian Sandpile
Let us define an <http://nautil.us/issue/23/dominoes/the-amazing-autotuning-sandpile Abelian sand pile> as a matrix that is only...

plus de 10 ans il y a

A résolu


Your favourite city!
Type your favourite city.

plus de 10 ans il y a

A résolu


Big Integer Multiplication
Implement big integer multiply. Input: A, B : N-by-M Matrix, each row represents a positive decimal integer. Output: ...

plus de 10 ans il y a

A résolu


Maximum of each diagonal
The well-known <http://www.mathworks.com/help/matlab/ref/max.html max> function can operate along either the rows or the columns...

plus de 10 ans il y a

A résolu


Make visible max values
Make visible maximum values of rows input = [1 2 3 4 5; 6 9 8 2 1; 2 1 4 5 8; 1 9 7 9 2]; ...

plus de 10 ans il y a

A résolu


Create cell array of numeric arrays
Convert the input to a cell array, but only if necessary. If the input is a numeric array, return a 1-by-1 cell array contain...

plus de 10 ans il y a

A résolu


Convert ColorSpec string to RGB triplet
Given a ColorSpec string, either in short or long form, return the corresponding RGB triplet. If the input is not a valid color,...

plus de 10 ans il y a

A résolu


Convert RGB triplet to ColorSpec string
This is the inverse to <http://www.mathworks.com/matlabcentral/cody/problems/42612-convert-colorspec-string-to-rgb-triplet this ...

plus de 10 ans il y a

A résolu


Create a figure and plot data
Given two data vectors (x,y), open a new figure and plot the data. Return the figure handle.

plus de 10 ans il y a

A résolu


Factorizing a number into a given number of factors
Given a positive integer, n, and another positive integer, b, return a matrix, M, of width b, with the following properties: (a)...

plus de 10 ans il y a

Charger plus