A résolu


Basic Monte Carlo Simulation
Input is a matrix including service time and probability of service time. Another input is a random number. Function should tran...

presque 8 ans il y a

A résolu


Perfect square.
Determine if the input is a perfect square or not. Example - If input is 25, return 1. If input is 17, return 0.

presque 8 ans il y a

A résolu


Calculate time taken by light to reach earth surface
We know the time(seconds) taken by light to reach surface of earth. What if the distance varies yearly or source of light moves ...

presque 8 ans il y a

A résolu


Extract leading non-zero digit
<http://en.wikipedia.org/wiki/Benford%27s_law Benford's Law> states that the distribution of leading digits is not random. This...

presque 8 ans il y a

A résolu


Happy 2013...
Happy 2013, everyone! An interesting tidbit about 2013 is that it is the first year since 1987 to contain four different digits...

presque 8 ans il y a

A résolu


Create tangent function out of sin and cos
Please don't use tan(x) directly

presque 8 ans il y a

A résolu


Convert degrees to radians
Given input in degrees, output to radians

presque 8 ans il y a

A résolu


Convert radians to degrees
Given input in radians, output to degrees

presque 8 ans il y a

A résolu


Create tangent function out of sine function only
Please don't use cosine and tangent functions

presque 8 ans il y a

A résolu


Rotate matrix by -90 degrees
Rotate a Matrix by -90 degrees Example: X = 1 2 3 4 5 6 7 8 9 output = 7 4 ...

presque 8 ans il y a

A résolu


Linear system of equations
Solve the system of equations in three variables.

presque 8 ans il y a

A résolu


Number of primes
Count the number of primes less than 'n'.

presque 8 ans il y a

A résolu


Create sine function out of cosine
Please don't use sin(x) directly

presque 8 ans il y a

A résolu


Determinant of a 3x3 Matrix
Return the determinant of a 3x3 matrix. The built-in Matlab function det is not allowed.

presque 8 ans il y a

A résolu


Find common elements in matrix rows
Given a matrix, find all elements that exist in every row. For example, given A = 1 2 3 5 9 2 5 9 3 2 5 9 ...

presque 8 ans il y a

A résolu


Temperature question
get the temperature...in celcius

plus de 8 ans il y a

A résolu


Diagonal Pattern
For a positive integer |n|, return an |nXn| matrix |mat| such that the value of each element in row |i| and column |j| is given ...

plus de 8 ans il y a

A résolu


Determine given vector is even or odd
Find the numbers of the input vector is odd or even then replace even with 1 and odd with 0 Example x = [ 3 3 4 6 1] ...

plus de 8 ans il y a

A résolu


Find the two most distant points
Given a collection of points, return the indices of the rows that contain the two points most distant from one another. The inpu...

plus de 8 ans il y a

A résolu


Back to basics 23 - Triangular matrix
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, return a matrix with all elements above a...

plus de 8 ans il y a

A résolu


Fahrenheit to Celsius converter
Convert Fahrenheit to Celsius degrees.

plus de 8 ans il y a

A résolu


Distance walked 3D
suppose you go from x-y-z coordinates [3,4,2] to [0,0,2] to [0,1,2] to [1,1,2], to [1,1,20] then you walked 25 units of distance...

plus de 8 ans il y a

A résolu


"mirror" matrix
Create n x 2n "mirror" matrix of this type: Examples For n = 2 m = [ 1 2 2 1 1 2 2 1 ] For n = 3 m = ...

plus de 8 ans il y a

A résolu


Number of digits in an integer
Specifies how many digits in a given integer. Example: in=100 ==> out=3

plus de 8 ans il y a

A résolu


Rotate a Matrix
Input a Matrix x, Output y is the matrix rotating x 90 degrees clockwise

plus de 8 ans il y a

A résolu


Find max
Find the maximum value of a given vector or matrix.

plus de 8 ans il y a

A résolu


Multiply a column by a row
* Given a column vector C and and a row vector R. * Output a matrix M. * Every column of M equals to C multiplied by correspon...

plus de 8 ans il y a

A résolu


Exponential decay
Many dynamic processes can be approximated as an exponential decay. This applies to radioactive decay, some chemical reactions, ...

plus de 8 ans il y a

A résolu


Angle between two vectors
You have two vectors , determine the angle between these two vectors For example: u = [0 0 1]; v = [1 0 0]; The a...

plus de 8 ans il y a

A résolu


Insert zeros into vector
Insert zeros after each elements in the vector. Number of zeros is specified as the input parameter. For example: x = [1 ...

plus de 8 ans il y a

Charger plus