A résolu


Number of Horns on a unicorn!
Calculate the number of horns on a *unicorn*! And I'm talking about a unicorn with not more than one horn on it!

environ 9 ans il y a

A résolu


Getting the indices from a vector
This is a basic MATLAB operation. It is for instructional purposes. --- You may already know how to <http://www.mathworks....

environ 9 ans il y a

A résolu


The Goldbach Conjecture, Part 2
The <http://en.wikipedia.org/wiki/Goldbach's_conjecture Goldbach conjecture> asserts that every even integer greater than 2 can ...

environ 9 ans il y a

A résolu


First N Perfect Squares
*Description* Return the first N perfect squares *Example* input = 4; output = [ 1 4 9 16 ];

environ 9 ans il y a

A résolu


Program an exclusive OR operation with logical operators
Program an exclusive or operation *without* using the MATLAB function xor. Use logical operators like |, &, ~, ... instead. ...

environ 9 ans il y a

A résolu


Remove DC
Input x is the sampled signal vector, may have both AC and DC components. Output y should not contain any DC component. Examp...

environ 9 ans il y a

A résolu


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

environ 9 ans il y a

A résolu


Rotate a Matrix by 90 degrees
Rotate a Matrix by 90 degrees Example: If the input is: X = 1 2 3 4 5 6 7 8 9 ...

environ 9 ans il y a

A résolu


add 8
add 8

environ 9 ans il y a

A résolu


Find my secret function IV
We use the same secret function used on the past "Find my secret function ..." x=23 -------->> y=3 X=1000 ------->> 163

environ 9 ans il y a

A résolu


Given a window, how many subsets of a vector sum positive
Given a vector: [1 0 -1 3 2 -3 1] and a window of 2, A sliding window would find: 1 + 0 = 1 0 - 1 = -1 ...

environ 9 ans il y a

A résolu


given 3 sides, find area of this triangle
1:3 -> 0; 3:5 -> 6

environ 9 ans il y a

A résolu


multiply 5
multiply 5

environ 9 ans il y a

A résolu


Back to basics 11 - Max Integer
Covering some basic topics I haven't seen elsewhere on Cody. Return the largest positive integer MATLAB can handle.

environ 9 ans il y a

A résolu


Remove all the words that end with "ain"
Given the string s1, return the string s2 with the target characters removed. For example, given s1 = 'the main event' your ...

environ 9 ans il y a

A résolu


Back to basics 22 - Rotate a matrix
Covering some basic topics I haven't seen elsewhere on Cody. Rotate the input matrix 90 degrees counterclockwise (e.g. [1 2; ...

environ 9 ans il y a

A résolu


Back to basics 8 - Matrix Diagonals
Covering some basic topics I haven't seen elsewhere on Cody. Given an input vector of numbers, output a square array with the...

environ 9 ans il y a

A résolu


Sums with Excluded Digits
Add all the integers from 1 to n in which the digit m does not appear. m will always be a single digit integer from 0 to 9. no...

environ 9 ans il y a

A résolu


Indexed Probability Table
This question was inspired by a Stack Overflow question forwarded to me by Matt Simoneau. Given a vector x, make an indexed pro...

environ 9 ans il y a

A résolu


prime test
find largest 2 digit prime number

environ 9 ans il y a

A résolu


Largest Prime Number
Given a matrix X, find the largest prime number in X.

environ 9 ans il y a

A résolu


Mersenne Primes
A Mersenne prime is a prime number of the form M = 2^p - 1, where p is another prime number. For example, 31 is a Mersenne prim...

environ 9 ans il y a

A résolu


Find out sum of prime number till given number
Find out sum of prime number till given number Example, if number is 10, then answer must be 17.

environ 9 ans il y a

A résolu


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

environ 9 ans il y a

A résolu


Find max prime number
Given integer number n. Find the max prime number (mpn) that smaller than or equal to n. Example: n = 10 --> mpn = 7

environ 9 ans il y a

A résolu


letter yes yes & letter no no
Split a string into two strings, wherein the first string has all alphabetic letters and the second string has all the remaining...

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

environ 9 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 9 ans il y a

A résolu


Find the maxmum value of N*N Matrix
Input x=[1 2 3; 4 5 6; 7 8 9] output: y=9

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

environ 9 ans il y a

Charger plus