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...
Create matrix of replicated elements
Given an input element x, and the dimensions, (m, n) return a matrix of size m x n filled with element x.
Example:
Input: ...
Pascal's Triangle
Given an integer n >= 0, generate the length n+1 row vector representing the n-th row of <http://en.wikipedia.org/wiki/Pascals_t...
3 years ago
Solved
Sum of series IX
What is the sum of the following sequence:
Σ 1/k! for k=1...n
for different n?
3 years ago
Solved
Sum of series IV
What is the sum of the following sequence:
Σ(-1)^(k+1) (2k-1)^2 for k=1...n
for different n?
3 years ago
Solved
Generate a vector like 1,2,2,3,3,3,4,4,4,4
Generate a vector like 1,2,2,3,3,3,4,4,4,4
So if n = 3, then return
[1 2 2 3 3 3]
And if n = 5, then return
[1 2 2 3 3 3 4...
3 years ago
Solved
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:...