Gelöst


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

fast 10 Jahre vor

Gelöst


find 90-45
find 90-45

fast 10 Jahre vor

Gelöst


Nth roots of unity
First, find the n nth roots of unity. eg if n = 6, find the n distinct (complex) numbers such that n^6 = 1. <https://en.wiki...

fast 10 Jahre vor

Gelöst


Pseudo Square Root (Inspired by Project Euler 266)
Shamelessly copied from the Project Euler page for Problem 266: ------------- The divisors of 12 are: 1,2,3,4,6 and 12. T...

fast 10 Jahre vor

Gelöst


Zero Cross
Write a function that counts the number of times n a signal x crosses zero or changes sign. Examples x = [1 2 -3 -4 5 6 ...

fast 10 Jahre vor

Gelöst


Find the inverse permutation
Given a permutation vector perm (a vector of n elements containing all the elements from 1 to n in some order), return the permu...

fast 10 Jahre vor

Gelöst


Counting the Grand Primes
A grand prime pair is a pair of primes, p1 and p2=p1+1000, such that both numbers are prime. Like a twin prime pair, where the d...

fast 10 Jahre vor

Gelöst


How many ways to write
How many ways to write a positive integer x as the sum of n numbers , where , x>n and no n number is less than -2.

etwa 10 Jahre vor

Gelöst


Find longest run
Write a function longest_run that takes as input an array of 0's and 1's and outputs the length and index of the longest consecu...

etwa 10 Jahre vor

Gelöst


Free-time Equation
Given a 7-day week, an *_nc_* -number of *_tc_* -hour classes, *_ta_* -hours awake in a day, and *_tw_* -hours that you work in ...

etwa 10 Jahre vor

Gelöst


Multipliying 2 numbers
Multiplying 2 numbers

etwa 10 Jahre vor

Gelöst


Vector 1 to 15.
Create a vector from 1 to 15.

etwa 10 Jahre vor

Gelöst


Area of a Circle
x=radius %construct the area of a circle using x and pi

etwa 10 Jahre vor

Gelöst


center of mass
R is a given matrix with size [n,2]. R(i,:) is interpreted as the 2D-position of a mass point with mass i. Calculate the center ...

etwa 10 Jahre vor

Gelöst


Polygon division
Given the number of vertices (or sides), n, of a planar convex polygon, return the number of ways, w, in which you can divide th...

etwa 10 Jahre vor

Gelöst


Increasing sub-sequence (Level 2)
This is the next step up from <http://www.mathworks.com/matlabcentral/cody/problems/42837-increasing-sub-sequence-level-1 Proble...

etwa 10 Jahre vor

Gelöst


Look Up Mapping
Let the input is A = {[] [] [] [1] []}; B = {'A','B','C','D','E'}; Mapped Output = 'D';

etwa 10 Jahre vor

Gelöst


Identify the sequence
Given a row vector, x, return 1 if it is an arithmetic series, or 2 if it is a geometric series. If it is neither, return 0. ...

etwa 10 Jahre vor

Gelöst


Transpose of matrix
Transpose of matrix as per test cases

etwa 10 Jahre vor

Gelöst


Increasing sub-sequence (Level 1)
Given a vector, v, of real numbers, return a positive integer, n, representing the longest contiguous increasing sub-sequence co...

etwa 10 Jahre vor

Gelöst


Height of a right-angled triangle
Given numbers a, b and c, find the height of the right angled triangle with sides a and b and hypotenuse c, for the base c. If a...

etwa 10 Jahre vor

Gelöst


테스트
입력으로 a, b, c를 주면 a*x^2 + b*x + c = 0. 의 해 (x)를 출력해주는 함수 solution 을 작성하라. 예) a=1, b=2, c=1 이면 x=-1

etwa 10 Jahre vor

Gelöst


테스트 문제
다음과 같은 일을 수행하는 사용자 정의 함수 switchrow 를 짜라. y = switchrow(x, a, b) 입력으로 행렬 x을 받으면 x의 a행과 b행을 바꿔서 출력하는 switchrow 사용자 정의 함수를 짜라...

etwa 10 Jahre vor

Gelöst


테스트
입력으로 벡터 x와 정수 n이 주어진 다면 벡터 x에서 n번째로 큰 수 (y)를 출력하는 함수 n_max(x, n) 를 작성하라. 만일 그런 수가 없다면 NaN (not a number)를 출력하면 된다. 예...

etwa 10 Jahre vor

Gelöst


테스트
벡터 x가 주어져 있으면 전체 벡터의 총합의 반을 만들어 주는 원소들 (y)을 출력하는 함수 subsub 을 작성하라 예) 입력 x = [1 2 3 4 5 6 7] 출력 y = [1 6 7] 이유 : ...

etwa 10 Jahre vor

Gelöst


테스트
다음과 같은 벡터를 1,2,2,3,3,3,4,4,4,4 만드는 사용자 정의 함수 your_fcn_name 을 작성하시오. 이 벡터는 그 숫자가 그 갯수 만큼 있다. 예) 만일 입력 n=3이면 3까지...

etwa 10 Jahre vor

Gelöst


테스트
만일 어떤 벡터 v가 0부터 0까지의 값들만 원소로 갖는다고 할때 [3 4 2 9] ---> 3429 [1 3 5] ---> 135 와 같이 벡터를 수로 변환하는 함수 digits2Number 를 ...

etwa 10 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;...

etwa 10 Jahre vor

Gelöst


Multiply by 3
There are many ways to obtain 3 times a number. You could multiply by 3, add the number 3 times, multiply by 6 and then subtract...

etwa 10 Jahre vor

Gelöst


Replace values out of an interval with the lower or upper values
For a vector or matrix X and an interval [n1,n2], the function replace every element of x inferior to n1 by n1, and every elemen...

etwa 10 Jahre vor

Mehr laden