A résolu


Fizz Buzz
Given an array of positive, non-zero, integers, return a cell array of strings the same size as the input, where each element in...

environ 12 ans il y a

A résolu


surrounded matrix
With a given matrix A (size m x n) create a matrix B (size m+2 x n+2) so that the matrix A is surrounded by ones: A = [1 2 ...

environ 12 ans il y a

A résolu


Volume of this donut
Given hole diameter a, and outermost diameter b, determine the volume y of the resulting donut.

environ 12 ans il y a

A résolu


Function composition
Write a function that accepts two function handles f and g and returns the composition h. That is, h = (f o g)(x) = f(g(x)) ...

environ 12 ans il y a

A résolu


Matrix with different incremental runs
Given a vector of positive integers a (>=0); How does one create the matrix where the ith column contains the vector 1:a(i) poss...

environ 12 ans il y a

A résolu


Circumscribed circles
Given the lengths of the 3 sides of a triangle, output the radius of the circumscribed circle. Example: [3 4 5] -> 2.5

environ 12 ans il y a

A résolu


System of equations
Find a solution to a system of equations represented by a |n| by |n+1| matrix. For instance, [ 2 0 4; => 2*x = 4 ...

environ 12 ans il y a

A résolu


Column norms of a matrix
Given a matrix M, return a vector y such that for each k y(k)=norm(M(:,k)) (y(k) is the Euclidean norm of the k-th col...

environ 12 ans il y a

A résolu


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

environ 12 ans il y a

A résolu


Number of toolboxes?
Return a number equal to the number of toolboxes available to the Cody solvers.

environ 12 ans il y a

A résolu


Angle of triangle
For three unknown points a b c, given three sides ab bc ca, find three angles abc bca cab in radians. Your function should b...

environ 12 ans il y a

A résolu


Back to basics 2 - Function Path
Covering some basic topics I haven't seen elsewhere on Cody. Given a string that is the name of a MATLAB function, return a s...

environ 12 ans il y a

A résolu


Figurate number triangle
Check whether the input matrix is a figurate number triangle: <http://mathworld.wolfram.com/FigurateNumberTriangle.html>

environ 12 ans il y a

A résolu


Solve the set of simultaneous linear equations
Given this pair of simultaneous linear equations: 2x + 3y = 23 3x + 4y = 32 Find the solution set (x,y)

environ 12 ans il y a

A résolu


peta to nano (x-ray)
for certain x-ray radiation, given frequency in petahertz, give wavelength in nanometer, must be accurate +/- 25%

environ 12 ans il y a

A résolu


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

environ 12 ans il y a

A résolu


Find indices of multiple minima in a vector
I have a vector, say: x= [ 1 5 6 2 6 1 3 5 1] Now I would like to get the index of the minimum values in this vector. When...

environ 12 ans il y a

A résolu


Find the "ordinary" or Euclidean distance between A and Z
A, B and Z define three points in the 3D _Euclidean_ space of the form: A = [x1;y1;0]; B = [x2;y2;0]; Z = [x2;y2;z]; Find th...

environ 12 ans il y a

A résolu


Are you in or are you out?
Given vertices specified by the vectors xv and yv, and a single point specified by the numbers X and Y, return "true" if the poi...

environ 12 ans il y a

A résolu


Tune your guitar
Given an input string with the scientific pitch notation for standard tuning ( <http://en.wikipedia.org/wiki/Guitar_tunings#Stan...

environ 12 ans il y a

A résolu


Find the largest value in the 3D matrix
Given a 3D matrix, A, find the largest value. E.g. >> A = 1:9; >> A=reshape(A,[3 1 3]); >> islargest(A) ans = 9

environ 12 ans il y a

A résolu


Number of Circles in a Number
Given a number, return the number of closed 'circles' in the base 10 numerical representation. Note: the number 4 has no circ...

environ 12 ans il y a

A résolu


Tricky timing
Write a function that takes between 0.5 seconds and 0.6 seconds to run.

environ 12 ans il y a

A résolu


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

environ 12 ans il y a

A résolu


Construct a string from letters and counts
Given two input arrays like this: [5,3,1] ['a','b','c'] Output a string that contains each letter the specified num...

environ 12 ans il y a

A résolu


Number of 1s in a binary string
Find the number of 1s in the given binary string. Example. If the input string is '1100101', the output is 4. If the input stri...

environ 12 ans il y a

A résolu


Project Euler: Problem 8, Find largest product in a large string of numbers
Find the greatest product of five consecutive digits in an n-digit number. 73167176531330624919225119674426574742355349194934...

environ 12 ans il y a

A résolu


Triangle Numbers Below N
This is an offshoot of <http://www.mathworks.com/matlabcentral/cody/problems/5-triangle-numbers Cody Problem 5: Triangle Numbers...

environ 12 ans il y a

A résolu


Determine if a Given Number is a Triangle Number
*Description:* Determine if the elements of an input array are triangle numbers and return the result as an array with the sa...

environ 12 ans il y a

A résolu


Read a Soroban Abacus
*Description* The Soroban is the name of the modern Japanese abacus. Information on reading a Soroban can be found <http://we...

environ 12 ans il y a

Charger plus