A résolu


What's Your BMI?
Find the body mass index. For reference, please refer to Wikipedia here: <http://en.wikipedia.org/wiki/Body_mass_index body ...

plus de 8 ans il y a

A résolu


Say something funny
Say something funny, or not. Your solution will be (fully automatically and objectively) scored based on how clever or funny ...

plus de 8 ans il y a

A résolu


Switch matrix to a column vector
for e.g. x = [1 2 3 4] y = 1 3 2 4

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

plus de 8 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 8 ans il y a

A résolu


Is it a number?
Determine if input is numeric. If it is,output is 1; if it is not, output is 0.

plus de 8 ans il y a

A résolu


Sophie Germain prime
In number theory, a prime number p is a *Sophie Germain prime* if 2p + 1 is also prime. For example, 23 is a Sophie Germain prim...

plus de 8 ans il y a

A résolu


Swap two numbers
Example Input: a = 10 b = 20 Output a = 20 b = 10

plus de 8 ans il y a

A résolu


Area of rhombus
Calculate the rhombus area

plus de 8 ans il y a

A résolu


Replacing a row
For matrix G=[1 2 3; 4 5 6; 7 8 9] Replace the 2nd row with 8s **remember to create matrix G

plus de 8 ans il y a

A résolu


Who has power to do everything in this world?
There is only one person who is older than this universe. He is Indian version of Chuck Norris.

plus de 8 ans il y a

A résolu


Back to basics 7 - Equal NaNs
Covering some basic topics I haven't seen elsewhere on Cody. Given 2 input variables, output true if they are equal, false ot...

plus de 8 ans il y a

A résolu


Back to basics 21 - Matrix replicating
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, generate an output matrix that consists o...

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

A résolu


Sum the Digits of a Number
Given an integer, sum the digits repeatedly until you end up with a single value less than 10. For example, if you add the di...

plus de 8 ans il y a

A résolu


Divide by 4
Given the variable x as your input, divide it by four and put the result in y.

plus de 8 ans il y a

A résolu


Building matrices
If you have matrix A, create matrix B using matrix A as an "element" A = [1 2 3 4; 5 6 7 8...

plus de 8 ans il y a

A résolu


Create a vector
Create a vector from 0 to n by intervals of 2.

plus de 8 ans il y a

A résolu


Counting down
Create a vector that counts from 450 to 200 in increments of 10.

plus de 8 ans il y a

A résolu


Return area of square
Side of square=input=a Area=output=b

plus de 8 ans il y a

A résolu


Compute Fibonacci Number
Compute the _n_-th Fibonacci Number f(0) = 0, f(1) = 1, f(2) = 1, f(3) = 2, ... f(42) = 267914296

plus de 8 ans il y a

A résolu


Find a Pythagorean triple
Given four different positive numbers, a, b, c and d, provided in increasing order: a < b < c < d, find if any three of them com...

plus de 8 ans il y a

A résolu


All your base are belong to us
Find the base _b_ logarithm of the input decimal number _x_. Express the output as a decimal number. The first argument is the n...

plus de 8 ans il y a

A résolu


The Dark Side of the Die
It is well-known that opposite sides of a classic hexahedral die add to 7. Given a vector of dice rolls, calculate the sum of th...

plus de 8 ans il y a

A résolu


Count up then down
Create a function that produces counting up from 0 up to n then down to 0 n=2 --> 0 1 2 1 0 n=3 --> ...

plus de 8 ans il y a

A résolu


Who is the smartest MATLAB programmer?
Who is the smartest MATLAB programmer? Examples: Input x = 'Is it Obama?' Output = 'Me!' Input x = 'Who ?' Ou...

plus de 8 ans il y a

A résolu


Test for balanced parentheses
Given the input inStr, give the boolean output out indicating whether all the parentheses are balanced. Examples: * If ...

plus de 8 ans il y a

A résolu


select the primes of a vector
Find the prime numbers in a vector

plus de 8 ans il y a

A résolu


The Answer to Life, the Universe, and Everything
A variation of a previous Hitchhiker's Guide to the Galaxy problem. *Inputs:* Life, the Universe, and Everything *Output:*...

plus de 8 ans il y a

A résolu


Basic commands - rounding
make a function which will round to integer, which is nearer to zero. Example x=[-2.5 2]; y=[-2 2];

plus de 8 ans il y a

Charger plus