Community Profile

# Mike

66 total contributions since 2011

View details...

Contributions in
View by

Solved

Back to basics 6 - Column Vector
Covering some basic topics I haven't seen elsewhere on Cody. Given an input vector, output true or false whether it is a colu...

alrededor de 6 años ago

Solved

Circle area using pi
Given a circle's radius, compute the circle's area. Use the built-in mathematical constant pi.

alrededor de 6 años ago

Solved

All capital?
Are all the letters in the input string capital letters? Examples: 'MNOP' -> 1 'MN0P' -> 0

alrededor de 6 años ago

Solved

Reverse the elements of an array
Reverse the order of elements in an array: eg: input X = [ 1 2 3 ; 4 5 6 ; 7 8 9 ] o...

más de 6 años ago

Solved

Determine Whether an array is empty
Input a matrix x, output y is TRUE if x is empty, otherwise FALSE.

más de 6 años ago

Solved

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

más de 6 años ago

Solved

Find the largest value in the 3D matrix
Given a 3D matrix, A, find the largest value. E.g. >> A = 1:9; >> A=reshape(A,[3 1 3]); >> islargest(A) ans = 9

más de 6 años ago

Solved

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

más de 6 años ago

Solved

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

más de 6 años ago

Solved

Factorize THIS, buddy
List the prime factors for the input number, in decreasing order. List each factor only once, even if the factorization includes...

más de 6 años ago

Solved

Make one big string out of two smaller strings
If you have two small strings, like 'a' and 'b', return them put together like 'ab'. 'a' and 'b' => 'ab' For extra ...

más de 6 años ago

Solved

inner product of two vectors
inner product of two vectors

más de 6 años ago

Solved

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

más de 6 años ago

Solved

Find max
Find the maximum value of a given vector or matrix.

más de 6 años ago

Solved

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

más de 6 años ago

Solved

Whether the input is vector?
Given the input x, return 1 if x is vector or else 0.

más de 6 años ago

Solved

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

más de 6 años ago

Solved

Arrange vector in ascending order
Arrange a given vector in ascending order. input = [4 5 1 2 9]; output = [1 2 4 5 9];

más de 6 años ago

Solved

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!

más de 6 años ago

Solved

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

más de 6 años ago

Solved

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

más de 6 años ago

Solved

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

más de 6 años ago

Solved

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.

más de 6 años ago

Solved

Check if number exists in vector
Return 1 if number _a_ exists in vector _b_ otherwise return 0. a = 3; b = [1,2,4]; Returns 0. a = 3; b = [1,...

más de 6 años ago

Solved

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

más de 6 años ago

Solved

Compute a dot product of two vectors x and y
x and y are input vectors, d is a number and contains their dot product

más de 6 años ago

Solved

Sum of diagonal of a square matrix
If x = [1 2 4; 3 4 5; 5 6 7] then y should be the sum of the diagonals of the matrix y = 1 + 4 + 7 = 12

más de 6 años ago

Solved

Arrange Vector in descending order
If x=[0,3,4,2,1] then y=[4,3,2,1,0]

más de 6 años ago

Solved

Sorted highest to lowest?
Return 1 if the input is sorted from highest to lowest, 0 if not. Example: 1:7 -> 0 [7 5 2] -> 1

más de 6 años ago

Solved

Roll the Dice!
*Description* Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. *Example* [x1,x2] =...

más de 6 años ago