Solved


find 90-45
find 90-45

9 years ago

Solved


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

9 years ago

Solved


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

9 years ago

Solved


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

9 years ago

Solved


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

9 years ago

Solved


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

9 years ago

Solved


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.

9 years ago

Solved


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

9 years ago

Solved


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

9 years ago

Solved


Multipliying 2 numbers
Multiplying 2 numbers

9 years ago

Solved


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

9 years ago

Solved


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

9 years ago

Solved


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

9 years ago

Solved


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

9 years ago

Solved


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

9 years ago

Solved


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

9 years ago

Solved


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

10 years ago

Solved


Transpose of matrix
Transpose of matrix as per test cases

10 years ago

Solved


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

10 years ago

Solved


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

10 years ago

Solved


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

10 years ago

Solved


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

10 years ago

Solved


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

10 years ago

Solved


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

10 years ago

Solved


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

10 years ago

Solved


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

10 years ago

Solved


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

10 years ago

Solved


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

10 years ago

Solved


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

10 years ago

Solved


Values in Array
How many values are in the array

10 years ago

Load more