Resuelto


Matrix spiral
Make a spiral in a (n*n) matrix. The spiral has to start in the top left, and has to rotate clockwise to the center. The spiral ...

más de 14 años hace

Resuelto


Flip the main diagonal of a matrix
Given a n x n matrix, M, flip its main diagonal. Example: >> M=magic(5); >> flipDiagonal(M) 9 24 1 ...

más de 14 años hace

Resuelto


Set defaults
Write a function that computes the volume of a cube. The function should be able to accept three inputs: the length, width, and...

más de 14 años hace

Resuelto


Sum of first n terms of a harmonic progression
Given inputs a, d and n, return the sum of the first n terms of the harmonic progression a, a/(1+d), a/(1+2d), a/(1+3d),....

más de 14 años hace

Resuelto


What are the odds?
Two numbers, A and B are drawn randomly and uniformly on [-R,R]. What is the probability that A*B < A+B. Your function should ...

más de 14 años hace

Resuelto


Surface Fit z(x,y)
Given three vectors x,y,z. Find four coefficients c = [cxx cxy cyy c00], such that z = cxx*x.^2+cxy*x.*y+cyy*y.^2+c00. For e...

más de 14 años hace

Resuelto


Stuff the Board
You have a stack of tiles to put onto an array-like playing board. Each tile has a number (always an integer), and the board var...

más de 14 años hace

Resuelto


Find best placement for ordered dominoes (harder)
Given a list of ordered pairs, find the order they should be placed in a line, such that the sum of the absolute values of the d...

más de 14 años hace

Resuelto


"Low : High - Low : High - Turn around " -- Create a subindices vector
Let two vectors *lo* and *hi* be given. The job is to create a index vector like so idx = [lo(1):hi(1) lo(2):hi(2) ...]...

más de 14 años hace

Resuelto


Find perfect placement of non-rotating dominoes (easier)
Given a list of ordered pairs, find the order they should be placed in a line, such that the sum of the absolute values of the d...

más de 14 años hace

Resuelto


Is this group simply connected?
Given connectivity information about a graph, your job is to figure out if the graph is fully connected. You are given a list of...

más de 14 años hace

Resuelto


Leaking?
Graham's law states that the rate of effusion of a gas is inversely proportional to the square root of its molecular weight. A b...

más de 14 años hace

Resuelto


Clock Hand Angle 1
Given a time in HH:MM:SS, find the smallest angle (in degrees) between the hour and minute hand

más de 14 años hace

Resuelto


Function Sniffer
* Given a string, * find out which built-in functions are present, * output a simple string, * that has sorted and unique ...

más de 14 años hace

Resuelto


Scoring for oriented dominoes
Given a list of ordered pairs, and the order they should be placed in a line, find the sum of the absolute values of the differe...

más de 14 años hace

Resuelto


Cody Computer Part 2 - Get the license number of Cody Computer
In the Cody computer investigation party, you may have already solved : <http://www.mathworks.com/matlabcentral/cody/problems...

más de 14 años hace

Resuelto


Create a square matrix of multiples
Given an input, N, output a matrix N x N with each row containing multiples of the first element of each row. This also applies...

más de 14 años hace

Resuelto


drowsy?
This dog() may be drowsy or function immediately when you call, return 1 or 0 accordingly within 2/10 second.

más de 14 años hace

Resuelto


count to vector
Return a matrix of numbers of dimension K by N, where K = prod(v), and N=length(v). The rows count from a vector of ones up to v...

más de 14 años hace

Resuelto


Pythagorean perfect squares: find the square of the hypotenuse and the length of the other side
Given the square root of a square number, *seed*, and a range, *n*, find the square number, *Z* as well as the other side, *y*, ...

más de 14 años hace

Resuelto


Four quadrant inverse tangent function.
Create a function that returns an array P the same size as X and Y containing the element-by-element, four-quadrant inverse tang...

más de 14 años hace

Resuelto


Differential equations I
Given a function handle |f| an initial condition |y0| and a final time |tf|, solve numerically the differential equation dy...

más de 14 años hace

Resuelto


Monte-Carlo integration
Write a function that estimates a d-dimensional integral to at least 1% relative precision. Inputs: * d: positive integer....

más de 14 años hace

Resuelto


hanoi towers II
with 3 rods (1,2 & 3), the goal is to move a tower of n disks from rod #1 to rod #3. You can move disks only one by one, on the...

más de 14 años hace

Resuelto


Converting Decimal to Binary
Given a decimal number that may include a fractional component, convert it into binary representation. The numbers you are given...

más de 14 años hace

Resuelto


Back to basics 24 - Symbolic variables
Covering some basic topics I haven't seen elsewhere on Cody. Given a string algebraic expression, return the symbolic variabl...

más de 14 años hace

Resuelto


Smallest distance between a point and a rectangle
Given two points *x* and *y* placed at opposite corners of a rectangle, find the minimal euclidean distance between another poin...

más de 14 años hace

Resuelto


Multiply to the limit?
If y = 4*x*x/pi/pi then what is the ultimate limiting result of (1+y/1/1)(1+y/3/3)(1+y/5/5)(1+y/7/7)... ... within 1000*eps?

más de 14 años hace

Resuelto


love is an n-letter word
Given a list of *N words*, return the *N-letter word* (choosing one letter from each word) with the property of having the least...

más de 14 años hace

Resuelto


Snakes on a plane
Given the dimensions of a 2-d plane, create a matrix where a "snake" of ones occupies the plane from top left to bottom right. ...

más de 14 años hace

Cargar más