已解决


Babylonian method
Calculate the square root of a given positive number a using the Babylonian method (https://en.wikipedia.org/wiki/Methods_of_co...

10 years 前

已解决


jumping astronauts
The surface gravity on the moon is approximately 2 m/s^2. Thats why an funny astronauts feels as light as a feather and jumps fr...

10 years 前

已解决


Juggler sequence revisited
This problem is related to <http://www.mathworks.com/matlabcentral/cody/problems/42835-return-the-sequence-element-ii Problem 42...

10 years 前

已解决


Return the sequence element II
Given positive integers x and n, return a positive integer, y, which is the nth term in the <https://en.wikipedia.org/wiki/Juggl...

10 years 前

已解决


Polygon division
Given the number of vertices (or sides), n, of a planar convex polygon, return the number of ways, w, in which you can divide th...

10 years 前

已解决


attenuation
A beam of X-rays propagates a length d(1) through a medium with an attenuation coefficient alpha(1). After that the beam propaga...

10 years 前

已解决


Return the sequence element
Given a positive integer, x, return a positive integer, y, which is the nth term in the sequence [1 2 2 3 3 3...], in which one ...

10 years 前

已解决


Number construction I
Given a positive integer, n, return a, b, c and d, such that 1. n = a*sqrt(b)+c*sqrt(d) 2. a, b, c and d are all positive ...

10 years 前

已解决


center of mass
R is a given matrix with size [n,2]. R(i,:) is interpreted as the 2D-position of a mass point with mass i. Calculate the center ...

10 years 前

已解决


Sorting integers by their digits (Level 2)
This is the next step up from <http://www.mathworks.com/matlabcentral/cody/problems/42809-sorting-integers-by-their-digits Probl...

10 years 前

已解决


Sorting integers by their digits (Level 1)
Given a vector, v, of positive integers, return a vector, w, by sorting v in ascending order, such that primary sorting is done ...

10 years 前

已解决


Britney Unfolded
You have a long, narrow strip of paper. You are going to fold this strip of paper length-wise in half, than fold the folded stri...

10 years 前

已解决


Approximate e
Given a and n, compute and approximation to f = a * e ^ n, without the use of exp, string operations, or floating point numbers....

10 years 前

已解决


Sum of Logarithms
Given a vector, v, of real positive numbers, compute the sum, s, of the base-10 logarithms of the elements of v, without the use...

10 years 前

已解决


Rolling maximums above a threshold
You are given either a vector or a 2-D matrix M and a threshold value of t. Write a script that will calculate how many times t...

10 years 前

问题


Rolling maximums above a threshold
You are given either a vector or a 2-D matrix M and a threshold value of t. Write a script that will calculate how many times t...

10 years 前 | 1 | 33 个解题者

已解决


house of cards
How many cards do one need to build a house of cards with n stages? Short explanation: /\ 2 cards for 1 stage ...

10 years 前

已解决


Find the path through the cell
A list of cells is given. Return true if the elements of the list increase monotonically (each element is strictly larger tha...

10 years 前

已解决


Fill the Matrix - 2
Input is a column vector and n. n columns will be added to the left of the input column. The first value of the row is the me...

10 years 前

已解决


Convert from integer to binary
if true % decimalToBinaryVector(x) end

10 years 前

已解决


MATLAB Prison: Absolute Cruelty
The warden of MATLAB prison is particularly cruel. Space is in short supply (too many criminals with bad grammar, no examples an...

10 years 前

已解决


While loop with multiple conditions
Write a while loop that multiplies userValue by 2 while userValue is not 10 and while userValue is less than 25.

10 years 前

已解决


Fast 1-D Convolution (full shape)
This is the first problem in the <http://www.mathworks.com/matlabcentral/cody/?term=Fast+1-D+Convolution fast 1-D convolution se...

10 years 前

已解决


MATLAB Prison: Summing light bulbs
On one wall in the MATLAB prison there is a row of n numbered light bulbs. Each bulb is controlled by a switch. Every morning, n...

10 years 前

已解决


Number of divisors of a given number
Given a Number n, return the number of his divisors without listing them example: n=14 ; Divisors={1,7,2,14} ; y=4 n=...

10 years 前

已解决


How many ways to write a number
Given two positive numbers n and k, where n>=k. In how many ways can we write n as sum of k positive numbers. Same numbers but d...

10 years 前

已解决


Rearrange string
Input is a given string. Output is the number of ways to rearrange the string.

10 years 前

已解决


Choose group with people
How many ways can you choose n groups of n people from n^2 people, assuming the groups are distinct? The number of people i...

10 years 前

已解决


Regular polygon bounded by and bounding a circle
As the number of sides (or vertices) of a regular polygon goes to infinity, its perimeter and area go to the perimeter and area ...

10 years 前

已解决


Number of pennies
Complete the function ConvertToPennies() so that the function returns the total number of pennies given a number of dollars and ...

10 years 前

加载更多