Community Profile

# Gergely Patay

1 937 total contributions since 2012

R&D physicist, LEGO enthusiast

View all

Contributions in
View by

Solved

Compound Interest Rate Calculation With Yearly Deposition Into A Bank Account
The problem adds a twist to the compound interest calculation by having the bank account owner depositing a fixed amount of mone...

1 jour ago

Solved

Separate even from odd numbers in a vector - with a loop
*Using a loop*, rearrange a vector of integers such that the odd numbers appear at the beginning, and even numbers at the end. T...

5 jours ago

Solved

Find the largest number
Given a vector v with 4 elements, find the largest number x. Example: Input: v = [4 7 1 6]; Output: x = 7; You mu...

5 jours ago

Solved

Find the centre of an arc and its radius
Given two points on an arc (x0,y0) and (x1,y1) and the angle between them, alpha. Return the centre of the circle and the rad...

5 jours ago

Solved

Given a Vector v1, create v2 which is the sum of each two adjacent elements in v1. {length(v2)=length(v1)-1}
if v1 is [1 2 3 4 5 6 7 8] then v2 should be [3 5 7 9 11 13 15]. if v1 is [1; 3; 5; 7] the...

6 jours ago

Solved

Invert a 3D rigid-body transformation
Given an SE(3) matrix representing a rigid-body motion, compute its inverse without using |inv()| or |pinv()| .

6 jours ago

Solved

Invert a 3D rotation matrix
Given a 3D rotation matrix, belonging to the matrix group SO(3), compute its inverse without using the functions |inv()| or |pin...

6 jours ago

Solved

Plot Line Specifications
Create a line plot for function cos(x) where x is a vector of linearly spaced values going from 0 to input N with an increment o...

6 jours ago

Solved

Minimum Distance Point to Segment
This Challenge is to determine the minimum distance from a 2-D line segment defined by two points to a point. The point is (p...

6 jours ago

Solved

Draw 'I'
Given n as input, draw a n-by-n matrix 'I' using 0 and 1. example: n=3 ans= [0 1 0 0 1 0 0 1 0] n=...

21 jours ago

Solved

Pi Digit Probability
Assume that the next digit of pi constant is determined by the historical digit distribution. What is the probability of next di...

21 jours ago

Solved

Diagonal Pattern
For a positive integer |n|, return an |nXn| matrix |mat| such that the value of each element in row |i| and column |j| is given ...

21 jours ago

Solved

cross in array
Make a cross from "1" in odd size array. Other value from array should be equal to "0"; As input you get length of side of arra...

21 jours ago

Solved

How many Integers?
Count the integers in a given vector |v|. You *must* use a loop to count each element separately. Examples: Input: v...

21 jours ago

Solved

Put m balls into n boxes
Can you find all the cases where, if I put 3 balls into 2 boxes the case is 1 1 1 1 1 2 1...

22 jours ago

Solved

ある数のベクトルが与えられた場合、そのベクトルの要素の一つが他の要素の二乗であれば true を返し、それ以外の場合は false を返すようなコードを書いてみましょう。 例: 入力が a = [2 3 4] のとき、 出力 b は t...

22 jours ago

Solved

22 jours ago

Solved

22 jours ago

Solved

22 jours ago

Solved

サイズが n*2n の "mirror" 行列（対称行列）を作成しましょう。 例: n=2 の場合、以下のような出力を返します。 m = [ 1 2 2 1 1 2 2 1 ] n = 3 の場合、以下のよう...

22 jours ago

Solved

22 jours ago

Solved

テレビのサイズを求めてみよう
あなたは電気屋で働いています。 あなたの電気屋にテレビを買いに来たお客さんに「何インチのテレビを買いたいのか」と質問したところ、対角線の情報しかわからないと言われてしまいました。 しかし、テレビのインチを知るには、幅と高さの情報が必要です。 ...

22 jours ago

Solved

NaN (欠損値) が含まれている行を削除しよう

22 jours ago

Solved

ベクトル b にあるスカラ値 a が含まれていれば出力として 1 を返し、含まれていなければ 0 を返すような関数を作成しましょう。 例: a = 3; b = [1,2,4]; スカラ値 3 はベクトル b に含まれていない...

22 jours ago

Solved

ゼロでない要素が一番多い行を探そう

22 jours ago

Solved

ベクトルの値が増加しているかを調べよう
ベクトルの値が増加している場合 (ベクトルの各要素が前の要素よりも大きい場合) には true を、そうでない場合には false を返すようなコードを書いてみましょう。 例: 入力が x = [-3 0 7] のとき、 関数の...

22 jours ago

Solved

Circular Primes (based on Project Euler, problem 35)
The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime. The...

22 jours ago

Solved

Remove element(s) from cell array
You can easily remove an element (or a column in any dimension) from a normal matrix, but assigning that value (or range) empty....

25 jours ago

Solved

String Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values
<http://www.mathworks.com/help/matlab/characters-and-strings.html String array> and cell array are two types of containers for s...

25 jours ago

Solved

Eye Squared
For a positive integer |n| create the identity matrix with |n| elements. In case it is not possible to produce an identity ma...

25 jours ago