Community Profile

# Philip

272 total contributions since 2013

View details...

Contributions in
View by

Solved

Project Euler: Problem 2, Sum of even Fibonacci
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 te...

environ 5 ans ago

Solved

only input
Return the output without writing any code into the function.

environ 5 ans ago

Solved

Output any real number that is neither positive nor negative
Output any real number that is neither positive nor negative

environ 5 ans ago

Solved

Check to see if a Sudoku Puzzle is Solved
*Description:* Your task, should you choose to accept it, is to make a function that checks to see if a 9x9 matrix of integer...

environ 5 ans ago

Solved

Find the largest value in the 3D matrix
Given a 3D matrix, A, find the largest value. E.g. >> A = 1:9; >> A=reshape(A,[3 1 3]); >> islargest(A) ans = 9

environ 5 ans ago

Solved

Number of 1s in a binary string
Find the number of 1s in the given binary string. Example. If the input string is '1100101', the output is 4. If the input stri...

environ 5 ans ago

Solved

give nth decimal place of pi
max 15th place after the decimal point is ok for now

environ 5 ans ago

Solved

Stuff the Board
You have a stack of tiles to put onto an array-like playing board. Each tile has a number (always an integer), and the board var...

environ 5 ans ago

Solved

Solitaire Cipher
Implement the <http://en.wikipedia.org/wiki/Solitaire_(cipher) solitaire cipher>. Since this is from Wikipedia, I am capturin...

environ 5 ans ago

Solved

How long is the longest prime diagonal?
Stanislaw Ulam once observed that if the counting numbers are <http://en.wikipedia.org/wiki/Ulam_spiral arranged in a spiral>, t...

environ 5 ans ago

Solved

Multiply 2 numbers
Very easy, you just have to multiply 2 numbers but you cannot use the following signs (*, /, - ,^) ,mtimes , times, cross, pro...

environ 5 ans ago

Solved

vectorization in N
For a given integer n (n>1), compute the sum f (i) (1 <= i <= n) where f (i) = 1 if n is odd and 2 otherwise.

environ 5 ans ago

Solved

02 - Vector Variables 2
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_2b.png>>

environ 5 ans ago

Solved

Given a 4x4 matrix, swap the two middle columns
If a = [1 2 3 4; 1 2 3 4; 1 2 3 4; 1 2 3 4]; then the result is ans = 1 3 2 4 1 3 2...

environ 5 ans ago

Solved

Number of digits in an integer
Specifies how many digits in a given integer. Example: in=100 ==> out=3

environ 5 ans ago

Solved

Geometric series
Find the sum, given the first term t1, the common ratio r, and number of terms n. Examples If input t1=1, r=1, n=7 the...

environ 5 ans ago

Solved

kmph to mps
convert kilometer per hour to meter per second

environ 5 ans ago

Solved

01 - Scalar variables
Create the following variables: <<http://samle.dk/STTBDP/Assignment1_1.png>>

environ 5 ans ago

Solved

Count up then down
Create a function that produces counting up from 0 up to n then down to 0 n=2 --> 0 1 2 1 0 n=3 --> ...

environ 5 ans ago

Solved

Min of a Matrix
Return the minimum value in the given matrix.

environ 5 ans ago

Solved

Return area of square
Side of square=input=a Area=output=b

environ 5 ans ago

Solved

No Twins?
Write a function that accepts as input a vector and returns the same vector, but retaining only the first occurrence of an eleme...

environ 5 ans ago

Solved

Return 'on' or 'off'
When the input is true, return 'on', otherwise, return 'off'.

environ 5 ans ago

Solved

Is A the inverse of B?
Given a matrix A and a matrix B, is A the inverse of B? >>A=[2,4;3,5]; >>B=[-2.5,2;1.5,-1]; >>isInverse...

environ 5 ans ago

Solved

Reverse the elements of an array
Reverse the order of elements in an array: eg: input X = [ 1 2 3 ; 4 5 6 ; 7 8 9 ] o...

environ 5 ans ago

Solved

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

environ 5 ans ago

Solved

Sum the numbers on the main diagonal
Sum the numbers on the main diagonal of an n-by-n matrix. For input: A = [1 2 4 3 6 2 2 4 7]...

environ 5 ans ago

Solved

The Answer to Life, the Universe, and Everything
A variation of a previous Hitchhiker's Guide to the Galaxy problem. *Inputs:* Life, the Universe, and Everything *Output:*...

environ 5 ans ago

Solved

sum of non-primes
The sum of the non-primes below 10 is 1+4+6+8+9+10=38 Find the sum of all the non-primes below the input, N.

environ 5 ans ago

Solved

Replace multiples of 5 with NaN
It is required to replace all values in a vector that are multiples of 5 with NaN. Example: input: x = [1 2 5 12 10 7] ...

environ 5 ans ago