A résolu


Circular Primes (based on Project Euler, problem 35)
The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime. The...

plus de 5 ans il y a

A résolu


Find the next prime number
Find the next prime number or numbers for given n. For example: n = 1; out = 2; or n = [5 7]; out = [7 11]; ...

plus de 5 ans il y a

A résolu


There are 10 types of people in the world
Those who know binary, and those who don't. The number 2015 is a palindrome in binary (11111011111 to be exact) Given a year...

plus de 5 ans il y a

A résolu


Find the next Fibonacci number
In the sequence of Fibonacci numbers, every number is the sum of the two preceding ones: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55...

plus de 5 ans il y a

A résolu


Return fibonacci sequence do not use loop and condition
Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: ...

plus de 5 ans il y a

A résolu


Get all prime factors
List the prime factors for the input number, in decreasing order. List each factor. If the prime factor occurs twice, list it as...

plus de 5 ans il y a

A résolu


Find the maximum number of decimal places in a set of numbers
Given a vector or matrix of values, calculate the maximum number of decimal places within the input. Trailing zeros do not coun...

plus de 5 ans il y a

A résolu


Natural numbers in string form
Create a cell array of strings containing the first n natural numbers. _Slightly_ harder than it seems like it should be. Ex...

plus de 5 ans il y a

A résolu


Fix the last element of a cell array
Note: this is lifted directly from <http://www.mathworks.com/matlabcentral/answers/82825-puzzler-for-a-monday Puzzler for a Mond...

plus de 5 ans il y a

A résolu


Remove element(s) from cell array
You can easily remove an element (or a column in any dimension) from a normal matrix, but assigning that value (or range) empty....

plus de 5 ans il y a

A résolu


Converting binary to decimals
Convert binary to decimals. Example: 010111 = 23. 110000 = 48.

plus de 5 ans il y a

A résolu


Binary code (array)
Write a function which calculates the binary code of a number 'n' and gives the result as an array(vector). Example: Inpu...

plus de 5 ans il y a

A résolu


Find out sum and carry of Binary adder
Find out sum and carry of a binary adder if previous carry is given with two bits (x and y) for addition. Examples Previo...

plus de 5 ans il y a

A résolu


Mersenne Primes vs. All Primes
A Mersenne prime (M) is a prime number of the form M = 2^p - 1, where p is another prime number. <https://www.mathworks.com/matl...

plus de 5 ans il y a

A résolu


Approximation of Pi (vector inputs)
Pi (divided by 4) can be approximated by the following infinite series: pi/4 = 1 - 1/3 + 1/5 - 1/7 + ... For a given numbe...

plus de 5 ans il y a

A résolu


Approximation of Pi
Pi (divided by 4) can be approximated by the following infinite series: pi/4 = 1 - 1/3 + 1/5 - 1/7 + ... For a given numbe...

plus de 5 ans il y a

A résolu


geometric progression
I've modified my <http://uk.mathworks.com/matlabcentral/cody/problems/2800-arithmetic-progression previous program> so that it n...

plus de 5 ans il y a

A résolu


arithmetic progression
I've written a program to generate the first few terms of <https://en.wikipedia.org/wiki/Arithmetic_progression arithmetic progr...

plus de 5 ans il y a

A résolu


Crate a vector of logarithmically spaced
Create a vector of logarithmically spaced from 10^0 to 10^x with n sample Example: if x=4 and n=3 Answer must be=[1 100 10...

plus de 5 ans il y a

A résolu


Find remainder when x is divided by 3
Find remainder when x is divided by 3

plus de 5 ans il y a

A résolu


Sum the rows
Sum the rows of the given matrix. Example x = [ 1 2 3 4 ] y = [ 3 7 ]

plus de 5 ans il y a

A résolu


Find hen's weight.
If hen weights x kilos on two legs, how much does it weights on one leg? Output the result.

plus de 5 ans il y a

A résolu


Convert Kilometers to Miles
Convert kilometers to miles. Consider 1 km = 0.62 mile. Note: Don't use the '*' operator.

plus de 5 ans il y a

A résolu


kmph to mph converter
Convert the speed in miles/hour to km/hour.

plus de 5 ans il y a

A résolu


Pull the variable y_correct from the Caller's Workspace
*Description* This highlights a very easy to use and high-scoring cheat that can be used on almost all Cody questions.

plus de 5 ans il y a

A résolu


Was ist denn los?
Nur für deutschsprechende Leute! Wie geht's? ...also gut, bis bald!

plus de 5 ans il y a

A résolu


Add two different item as shown in example
Add two different item as shown in example x=5; y='ab'; Then output must be'5ab';

plus de 5 ans il y a

A résolu


When can one be the Life Member of the IEEE?
Consult the site http://en.wikipedia.org/wiki/Ieee from where it can be seen that IEEE Members who have reached the age of 65 an...

plus de 5 ans il y a

A résolu


Change Vector Value
Change the element of the vector with respect to the element of the direction vector If the element of the direction vecto...

plus de 5 ans il y a

A résolu


Test if a number is numeric or not
Test if a number is numeric or not

plus de 5 ans il y a

Charger plus