Solved

Lunar Arithmetic (Multiplication)

<https://oeis.org/A087061 OEIS link for a description of lunar arithmetic> Simply take the larger digit when adding and take ...

1 month ago

Solved

The number of trailing zero digit of a factorial

For given positive integer n, take factorial of that number. How many trailing zeros does it have? Example: factorial(11) = 3...

1 month ago

Solved

Whole Number Concatenator

Write a function that concatenates whole numbers. For example: numcat(111,222) should return 111222 numcat(1,2,3,4,5) s...

1 month ago

Solved

Better Index Number

Let's say you want to save many, many files and append these files with a certain sortable index number. As you probably know, y...

1 month ago

Solved

Whole Number Un-Concatenator

Write a function that accepts an integer and an index digit and returns a vector containing two integers which are the leading a...

1 month ago

Solved

The last non-zero digit of a factorial

For given positive integer n, what is the last non-zero digit of n!? Example: factorial(11) = 39916800 Last non-zero d...

1 month ago

Solved

Permutation Via Multiplication

Given two numbers a and b, determine if the product ab is a permutation of the digits of a. For example, this is always true for...

1 month ago

Solved

Lunar Arithmetic (Addition)

<https://oeis.org/A087061 OEIS link for a description of lunar arithmetic> Simply take the larger digit. Example 1: ...

2 months ago

Solved

Expand 10^n to Powers of 4

Given an integer n, return the coefficients c = [c_n,c_n-1,...,c_0] Such that 10^n = c_n*4^(n) + c_n-1*4^(n-1...

2 months ago

Solved

7 segment LED display

Given a whole number, output how many segments would be lit up to display it on a 7 segment LED display (see Wikipedia: <http://...

2 months ago

Solved

Test if a Number is a Palindrome without using any String Operations

*Description* Given an integer _X_, determine if it is a palindrome number. That is, _X_ is equal to the _X_ with the digits ...

2 months ago

Solved

Increment a number, given its digits

Take as input an array of digits (e.g. x = [1 2 3]) and output an array of digits that is that number "incremented" properly, (i...

2 months ago

Question

why my Matlab code is not passing the test suite? [Cody]

https://www.mathworks.com/matlabcentral/cody/groups/3755/problems/44705 function a = ten2pow4(n) format rat c = zeros...

2 months ago | 0 answers | 0

Solved

Vector creation

Create a vector using square brackets going from 1 to the given value x in steps on 1. Hint: use increment.

2 months ago

Solved

Doubling elements in a vector

Given the vector A, return B in which all numbers in A are doubling. So for: A = [ 1 5 8 ] then B = [ 1 1 5 ...

2 months ago

Solved

Flip the vector from right to left

Flip the vector from right to left. Examples x=[1:5], then y=[5 4 3 2 1] x=[1 4 6], then y=[6 4 1]; Request not ...

2 months ago

Solved

Whether the input is vector?

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

2 months ago

Solved

Get the length of a given vector

Given a vector x, the output y should equal the length of x.

2 months ago

Solved

Sum all integers from 1 to 2^n

Given the number x, y must be the summation of all integers from 1 to 2^x. For instance if x=2 then y must be 1+2+3+4=10.

2 months ago

Solved

Magic is simple (for beginners)

Determine for a magic square of order n, the magic sum m. For example m=15 for a magic square of order 3.

2 months ago

Solved

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

2 months ago

Solved

Roll the Dice!

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

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

2 months ago

Solved

Return the first and last character of a string

Return the first and last character of a string, concatenated together. If there is only one character in the string, the functi...

2 months ago

Solved

Create times-tables

At one time or another, we all had to memorize boring times tables. 5 times 5 is 25. 5 times 6 is 30. 12 times 12 is way more th...

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

2 months ago