A résolu


Cannon Ball
Given g (acceleration due to gravity) and desired altitude x, find the minimum ground velocity of a cannon ball to reach x.

plus de 10 ans il y a

A résolu


Geometric series
Find the sum, given the first term t1, the common ratio r, and number of terms n. Examples If input t1=1, r=1, n=7 the...

plus de 10 ans il y a

A résolu


Lightning strike distance: Writing a function
Write a function named LightningDistance that outputs "distance" given input "seconds". Seconds is the time from seeing lightnin...

plus de 10 ans il y a

A résolu


Add a row of zeros on top of a matrix
Given a matrix, insert a row of zeros as the top row.

plus de 10 ans il y a

A résolu


Convert a structure into a string
Convert the contents of each fields into a string. Example with an input structure s with 2 fields : s.age = '33' s....

plus de 10 ans il y a

A résolu


Signed Magnitude
For a given input vector, return the value that is furthest from zero. For example, if x = [1 2 -12] return -12.

plus de 10 ans il y a

A résolu


Factorial !
Calculate the factorial of a non-negative integer without using the built in function *factorial*

plus de 10 ans il y a

A résolu


Determine if input is a perfect number
A <http://en.wikipedia.org/wiki/Perfect_number/ perfect number> occurs whent the sum of all divisors of a positive integer, exce...

plus de 10 ans il y a

A résolu


Change the sign of even index entries of the reversed vector
change the signs of the even index entries of the reversed vector example 1 vec = [4 -1 -2 9] ans = [9 2 -1 -4] example2...

plus de 10 ans il y a

A résolu


Symmetric matrix
You must create a n-by-n *symmetric* matrix such that A(row,col) = row/col for col >= row. Example if n =3 : output is : ...

plus de 10 ans il y a

A résolu


Create a vector whose elements depend on the previous element
The idea is to create a vector A whose elements depend on the previous element : *A(i+1) = 2*A(i)+1* *2 Inputs*: - A : The...

plus de 10 ans il y a

A résolu


Reverse the Words (not letters) of a String
*Description* Change the words of a string such that the words appear in reverse order. You may assume that the string is a n...

plus de 10 ans il y a

A résolu


Create One Large Eye of size N x N Quickly?
*<http://en.wikipedia.org/wiki/Aye_(yes) Aye !!!>*

plus de 10 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...

plus de 10 ans il y a

A résolu


Create a random logical vector of N elements of which M are true.
Your task for tomorrow is to create a random binary (logical) vector of N elements of which M are true. For example: ran...

plus de 10 ans il y a

A résolu


Set some matrix elements to zero
First get the maximum of each *row*, and afterwards set all the other elements to zero. For example, this matrix: 1 2 3 ...

plus de 10 ans il y a

A résolu


Elapsed time is -0.005204 seconds.
Write a function that takes less than zero seconds to execute, as measured using tic and toc. For repeatability, the test case p...

plus de 10 ans il y a

A résolu


vectorization in N
For a given integer n (n>1), compute the sum f (i) (1 <= i <= n) where f (i) = 1 if n is odd and 2 otherwise.

plus de 10 ans il y a

A résolu


find radius of cone
if Slant height of Cone(I)& hight of Cone(H) given then find radius of the Cone(R) for example I=5,h=4 then the ans R=3;

plus de 10 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.

plus de 10 ans il y a

A résolu


More luck than brains
Give a random function that guess and return numbers from 1 to 6 exactly like the test suite .

plus de 10 ans il y a

A résolu


Project Euler: Problem 5, Smallest multiple
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smalle...

plus de 10 ans il y a

A résolu


Specific toolboxes
Given a string that is the name of a MATLAB toolbox, return true if it is available on the Cody solvers evaluation system, false...

plus de 10 ans il y a

A résolu


Test if two numbers have the same digits
Given two integers _x1_ and _x2_, return |true| if the numbers written with no leading zeros contain the same digits. That is, t...

plus de 10 ans il y a

A résolu


Is the Point in a Circle?
Check whether a point or multiple points is/are in a circle centered at point (x0, y0) with radius r. Points = [x, y]; c...

plus de 10 ans il y a

A résolu


Create a function handle that reverses the input arguments of another function handle
Given a function that takes two input arguments and returns one output, create another function handle that performs the same op...

plus de 10 ans il y a

A résolu


Alternating sum
Given vector x, calculate the alternating sum y = x(1) - x(2) + x(3) - x(4) + ...

plus de 10 ans il y a

A résolu


wait for me
wait exactly x seconds please, need not be more than 2 seconds but must be accurate within say 50 milliseconds, your function mu...

plus de 10 ans il y a

A résolu


We love vectorized solutions. Problem 1 : remove the row average.
Given a 2-d matrix, remove the row average from each row. Your solution MUST be vectorized. The solution will be tested for ac...

plus de 10 ans il y a

A résolu


Project Euler: Problem 9, Pythagorean numbers
A Pythagorean triplet is a set of three natural numbers, a b c, for which, a^2 + b^2 = c^2 For example, 3^2 + 4^2 =...

plus de 10 ans il y a

Charger plus