A résolu


Project Euler: Problem 10, Sum of Primes
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below the input, N. Thank you <http:/...

presque 11 ans il y a

A résolu


Project Euler: Problem 6, Natural numbers, squares and sums.
The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ...

presque 11 ans il y a

A résolu


Back to basics 10 - Max Float
Covering some basic topics I haven't seen elsewhere on Cody. Return the largest positive floating-point number MATLAB can han...

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

presque 11 ans il y a

A résolu


The Hitchhiker's Guide to MATLAB
Output logical "true" if the input is the answer to life, the universe and everything. Otherwise, output logical "false".

presque 11 ans il y a

A résolu


Duplicate each element of a vector.
for an n-dimensional vector x, the function should return another vector 2n-dimension which each element is repeated twice. Ex...

presque 11 ans il y a

A résolu


Back to basics 17 - white space
Covering some basic topics I haven't seen elsewhere on Cody. Remove the trailing white spaces from the input variable

presque 11 ans il y a

A résolu


Is A the inverse of B?
Given a matrix A and a matrix B, is A the inverse of B? >>A=[2,4;3,5]; >>B=[-2.5,2;1.5,-1]; >>isInverse...

presque 11 ans il y a

A résolu


Project Euler: Problem 1, Multiples of 3 and 5
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23...

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

presque 11 ans il y a

A résolu


Add two numbers
Calculate the sum of two numbers. Example input = [2 3] output = 5

presque 11 ans il y a

A résolu


Generate a vector like 1,2,2,3,3,3,4,4,4,4
Generate a vector like 1,2,2,3,3,3,4,4,4,4 So if n = 3, then return [1 2 2 3 3 3] And if n = 5, then return [1 2 2...

presque 11 ans il y a

A résolu


Replace Vector Elements
Replace all elements in a vector which are equal to or smaller than zero with 0.1. Example: A = [1 2 3 -1 0 2 -3 -80]; ...

presque 11 ans il y a

A résolu


Make a random, non-repeating vector.
This is a basic MATLAB operation. It is for instructional purposes. --- If you want to get a random permutation of integer...

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

presque 11 ans il y a

A résolu


No Twins?
Write a function that accepts as input a vector and returns the same vector, but retaining only the first occurrence of an eleme...

presque 11 ans il y a

A résolu


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

presque 11 ans il y a

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!

presque 11 ans il y a

A résolu


2 b | ~ 2 b
Given a string input, output true if there are 2 b's in it, false if otherwise Examples: 'Macbeth' -> false 'Publius Cor...

presque 11 ans il y a

A résolu


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

presque 11 ans il y a

A résolu


Who knows the last digit of pi?
There is only one man who knows the last digit of pi, who is that man? Give the name of that man, who, by popular believe, can ...

presque 11 ans il y a

A résolu


pressure to dB?
given x ratio of pressure, find corresponding y dB

presque 11 ans il y a

A résolu


Convert a vector into a number
This is a sub problem related to this problem: <http://www.mathworks.com/matlabcentral/cody/problems/621-cryptomath-addition>...

presque 11 ans il y a

A résolu


give nth decimal place of pi
max 15th place after the decimal point is ok for now

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

presque 11 ans il y a

A résolu


Tell me the slope
Tell me the slope, given a vector with horizontal run first and vertical rise next. Example input: x = [10 2];

presque 11 ans il y a

A résolu


surface of a spherical planet
you just discovered its circumference, that is the input.

presque 11 ans il y a

A résolu


Bottles of beer
Given an input number representing the number of bottles of beer on the wall, output how many are left if you take one down and ...

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

presque 11 ans il y a

A résolu


Back to basics 15 - classes
Covering some basic topics I haven't seen elsewhere on Cody. Return the class of the input variable.

presque 11 ans il y a

Charger plus