Gelöst


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

mehr als 5 Jahre vor

Gelöst


Sum of the Multiplication of Vectors
Given the vectors x and y as input, multiply the vectors and return the summation of its elements. Example: x = [1 2 ...

mehr als 5 Jahre vor

Gelöst


Narcissistic number ?
Inspired by Problem 2056 created by Ted. In recreational number theory, a narcissistic number is a number that is the sum of ...

mehr als 5 Jahre vor

Gelöst


Test if two numbers have the same digits
Given two integers _x1_ and _x2_, return |true| if the numbers written with no leading zeros contain the same digits. That is, t...

mehr als 5 Jahre vor

Gelöst


Sum of series V
What is the sum of the following sequence: Σk(k+1) for k=1...n for different n?

mehr als 5 Jahre vor

Gelöst


Write a code that will follow the equation y = x * (x + x) * x.
If x = 5, y = 5 * (5+5) * 5 = 250

mehr als 5 Jahre vor

Gelöst


Find the sum of n squares
What is the sum of the squares of the first n integers?

mehr als 5 Jahre vor

Gelöst


Calculate solution of given polynomial
For example, y=function([3 -2 -4]) In here, input vector indicate 3*x^2-2*x-4, y is solution of former equation. y=[1.5...

mehr als 5 Jahre vor

Gelöst


Let's see how peculiar we can get
The task is to multiply two numbers. But do it in the most peculiar possible way.

mehr als 5 Jahre vor

Gelöst


Max index of 3D array
Given a three dimensional array M(m,n,p) write a code that finds the three coordinates x,y,z of the Maximum value. Example ...

mehr als 5 Jahre vor

Gelöst


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

mehr als 5 Jahre vor

Gelöst


Vectorize the digits of an Integer
Create a vector of length N for an integer of N digits. x = 123045; x_vec = [1 2 3 0 4 5]; I happened upon a trick ...

mehr als 5 Jahre vor

Gelöst


Count decimal digits of a number
* Given an integer number you have to return the number of its digits. * For example 248 has 3 digits and 1589 has 4 digits ...

mehr als 5 Jahre vor

Gelöst


Number of Circles in a Number
Given a number, return the number of closed 'circles' in the base 10 numerical representation. Note: the number 4 has no circ...

mehr als 5 Jahre vor

Gelöst


Sideways sum
Given natural number calculate its _population count_.

mehr als 5 Jahre vor

Gelöst


Rotate Matrix Clockwise (45 Degree)
*Matrix (3x3 only) rotation clockwise*: 2 inputs: *x* matrix and *n* times. output: *y* matrix with *n x 45* degree ro...

mehr als 5 Jahre vor

Gelöst


Calculate numerical integration.
x=0:0.01:1 y=@(x)x.^2 Using given two inputs(x and y), conduct numerical integration in x. (hint: trapz)

mehr als 5 Jahre vor

Gelöst


calculate RMS voltage
given peak to peak voltage, calculate rms voltage

mehr als 5 Jahre vor

Gelöst


Output a vector which is table of 9
Output a vector which is table of 9

mehr als 5 Jahre vor

Gelöst


row removal
Remove the nth row from input matrix M and return the resulting matrix in output N.

mehr als 5 Jahre vor

Gelöst


Find nth maximum
Find nth maximum in a vector of integer numbers. Return NaN if no such number exists. x = [2 6 4 9 -10 3 1 5 -10]; So ...

mehr als 5 Jahre vor

Gelöst


Sort the vector with the given index
Given x = [1 2 4 8 17] and t = [1 3 2 5 4] then y = [1 4 2 17 8].

mehr als 5 Jahre vor

Gelöst


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

mehr als 5 Jahre vor

Gelöst


Rotate Matrix @180 degree
Rotate Matrix @180 degree Example A=[8 1 6; 3 5 7; 4 9 2], then answer would be [2 9 4;...

mehr als 5 Jahre vor

Gelöst


vectors counting by 5
Create a vector with numbers from x_min to x_max in increments of 5.

mehr als 5 Jahre vor

Gelöst


Rotate matrix by -90 degrees
Rotate a Matrix by -90 degrees Example: X = 1 2 3 4 5 6 7 8 9 output = 7 4 ...

mehr als 5 Jahre vor

Gelöst


What is the distance from point P(x,y) to the line Ax + By + C = 0?
Given a point, P(x,y), find the distance from this point to a linear line. INPUTS: x, y, A, B, C OUTPUTS: d, the distance ...

mehr als 5 Jahre vor

Gelöst


Square Diagonal
If n is the given number, then make a diagonal matrix of size 2*2 with the square of that number.

mehr als 5 Jahre vor

Gelöst


Determinants
Given a square matrix(A), find the determinant(d). For example: A = [1,3;4,5] d = 1*5-4*3 = -7

mehr als 5 Jahre vor

Gelöst


The answer to life the universe and everything
Write a function that gives the answer to life the universe and everything to every input except the input is 42. In this case t...

mehr als 5 Jahre vor

Mehr laden