Solved


Project Euler: Problem 6, Natural numbers, squares and sums.
The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ...

8 years ago

Solved


Project Euler: Problem 7, Nth prime
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the Nth prime nu...

8 years ago

Solved


Back to basics 15 - Benchmark
Covering some basic topics I haven't seen elsewhere on Cody. Return an array of the benchmark values for MATLAB.

8 years ago

Solved


The sum of the numbers in the vector
eg. [1,2,3]---->SUM=6

8 years ago

Solved


Replace May with April
For instance, if the input is input_str = 'The flowers may bloom in April'; then the output is output_str = 'The flo...

8 years ago

Solved


Solving Quadratic Equations (Version 1)
Quadratic equations have the form: ax^2 + bx + c = 0. Example: x^2 + 3x + 2 = 0, where a = 1, b = 3, and c = 2. The equation has...

8 years ago

Solved


Back to basics 15 - classes
Covering some basic topics I haven't seen elsewhere on Cody. Return the class of the input variable.

8 years ago

Solved


03 - Matrix Variables 1
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_3a.png>> A 9x9 matrix full of 2's (Hint: use *ones* o...

8 years ago

Solved


03 - Matrix Variables 4
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_3d.png>> A 3x4 NaN (Not a Number) matrix (Hint: use ...

8 years ago

Solved


How long is the longest prime diagonal?
Stanislaw Ulam once observed that if the counting numbers are <http://en.wikipedia.org/wiki/Ulam_spiral arranged in a spiral>, t...

8 years ago

Solved


Alphabetize by last name
Given a list of names in a cell array, sort the list by the last name. So if list = {'Barney Google','Snuffy Smith','Dagwood ...

8 years ago

Problem


Arrange the names in alphabetical order (2)
Arrange the list of names in alphabetical order, following the German standard <https://de.wikipedia.org/wiki/Alphabetische_Sort...

8 years ago | 3 | 7 solvers

Problem


Arrange the names in alphabetical order (1)
Arrange the list of names in alphabetical order. The _original_ 'alphabetical order', that is: from α and β all the way throug...

8 years ago | 2 | 9 solvers

Solved


Back to basics 1 - Saving
Covering some basic topics I haven't seen elsewhere on Cody. Given an input variable 'x', save it to disk in a file named 'co...

8 years ago

Solved


Funny problems
Generate the following vector: if n=1 then q=1; elseif n=2 then q=[2 2 1]; elseif n=3 then q=[3 3 3 2 2 1]; ... end

8 years ago

Solved


Determine if input is a valid AHP evaluation matrix
Input is a matrix. Output is a true or false statement (1 or 0). Return true if input is a valid Analytic Hierarchy Process eval...

8 years ago

Solved


Besson Ranks
Return Besson Ranks. You can look at <https://www.sciencedirect.com/science/article/pii/0895717789903671 this article.> Besso...

8 years ago

Solved


Find the repeating elements and repetitions of a row vector.
So let's say that x is a vector, for example, x = [4, 4, 5, 5, 5, 6, 7, 7,8, 8, 8, 8] Now we want to get the following two ve...

8 years ago

Solved


2) Are you more familiar with iteration methods or Linear Algebra ? Let's see together.
Referring to problem: https://www.mathworks.com/matlabcentral/cody/problems/44530-are-you-more-familiar-with-iteration-method...

8 years ago

Solved


Are you more familiar with iteration methods or Linear Algebra? Let's see together.
Given a sum result *_x_* value of a *_N_* number of addends, build an array of _*N*_ elements _*y*_ such that the following equa...

8 years ago

Solved


Remove the air bubbles
Given a matrix a, return a matrix b in which all the zeros have "bubbled" to the top. That is, any zeros in a given column shoul...

8 years ago

Solved


Find if a given sentence is a palindrome
Given a string/character array, return true if the string is a palindrome else returns false. For example: sample_text =...

8 years ago

Solved


Read it !
read and return the following word. 'M M A TTTTTTTTTL A BBB ' 'MM MM A A T L ...

8 years ago

Solved


Pattern Sum
Write a function which receives two single digit positive integers, (k and m) as parameters and calculates the total sum as: k...

8 years ago

Solved


Perimeter of a quadrilateral
There are four cars starting at a point. The first car points north, the second one points east, the third one points south, an...

8 years ago

Problem


Test the tester — develop your own Test Suite
In this task you need to imagine that you — _yes, YOU_ — have developed a problem on Cody for _me_ to solve, and now *you need t...

8 years ago | 3 | 3 solvers

Solved


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

8 years ago

Solved


More Simple String Concatenation
Take the first string input, reverse the order of the string from the end to beginning (i.e. apple becomes elppa), add a space a...

8 years ago

Solved


Simple String Concatenation
This is a simple problem involving taking two incoming strings, and outputting the concatenated string with a space separating t...

8 years ago

Solved


Please check if calorie intake is less than 300 kcal.
I like eating some puddings and some chocolate cookies around 3 o'clock. However, I care about calorie intake. Please check whe...

8 years ago

Load more