Community Profile

# Mark Shore

### Magma Geosciences Inc.

41 2011 年以降の合計貢献数

Geophysicist involved in mineral exploration

#### Mark Shore's バッジ

Times 2 - START HERE
Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...

7年以上 前

Volume of a Parallelepiped
Calculate the volume of a Parallelepiped given the vectors for three edges that meet at one vertex. A cube is a special case ...

7年以上 前

surface of a spherical planet
you just discovered its circumference, that is the input.

7年以上 前

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

7年以上 前

Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

7年以上 前

Distance walked 3D
suppose you go from x-y-z coordinates [3,4,2] to [0,0,2] to [0,1,2] to [1,1,2], to [1,1,20] then you walked 25 units of distance...

7年以上 前

given 3 sides, find area of this triangle
1:3 -> 0; 3:5 -> 6

7年以上 前

you just measured its surface area, that is the input.

7年以上 前

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

7年以上 前

Find the sum of all the numbers of the input vector
Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

7年以上 前

Return the 3n+1 sequence for n
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

7年以上 前

Reverse the vector
Reverse the vector elements. Example: Input x = [1,2,3,4,5,6,7,8,9] Output y = [9,8,7,6,5,4,3,2,1]

7年以上 前

inner product of two vectors
inner product of two vectors

7年以上 前

Distance walked 1D
Suppose you go from position 7 to 10 to 6 to 4. Then you have walked 9 units of distance, since 7 to 10 is 3 units, 10 to 6 is 4...

7年以上 前

Sorted highest to lowest?
Return 1 if the input is sorted from highest to lowest, 0 if not. Example: 1:7 -> 0 [7 5 2] -> 1

7年以上 前

Project Euler: Problem 1, Multiples of 3 and 5
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23...

7年以上 前

Factorize THIS, buddy
List the prime factors for the input number, in decreasing order. List each factor only once, even if the factorization includes...

7年以上 前

The Hitchhiker's Guide to MATLAB
Output logical "true" if the input is the answer to life, the universe and everything. Otherwise, output logical "false".

7年以上 前

Multiply to the limit?
If y = 4*x*x/pi/pi then what is the ultimate limiting result of (1+y/1/1)(1+y/3/3)(1+y/5/5)(1+y/7/7)... ... within 1000*eps?

7年以上 前

Given a and b, return the sum a+b in c.

7年以上 前

Make a checkerboard matrix
Given an integer n, make an n-by-n matrix made up of alternating ones and zeros as shown below. The a(1,1) should be 1. Example...

7年以上 前

Finding Perfect Squares
Given a vector of numbers, return true if one of the numbers is a square of one of the other numbers. Otherwise return false. E...

7年以上 前

Determine whether a vector is monotonically increasing
Return true if the elements of the input vector increase monotonically (i.e. each element is larger than the previous). Return f...

7年以上 前

Column Removal
Remove the nth column from input matrix A and return the resulting matrix in output B. So if A = [1 2 3; 4 5 6]; and ...

7年以上 前

Arrange Vector in descending order
If x=[0,3,4,2,1] then y=[4,3,2,1,0]

7年以上 前

Check if sorted
Check if sorted. Example: Input x = [1 2 0] Output y is 0

7年以上 前

Pizza!
Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.] Non-scor...

7年以上 前

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.

7年以上 前

Too mean-spirited
Find the mean of each consecutive pair of numbers in the input row vector. For example, x=[1 2 3] ----> y = [1.5 2.5] x=[1...

7年以上 前

Weighted average
Given two lists of numbers, determine the weighted average. Example [1 2 3] and [10 15 20] should result in 33.333...

7年以上 前