Flipping a Matrix
Flipping matrix up and down.
If a central row is exists, leave it, and flip remaining rows.
Example
Mat = magic(3)
...
8年弱 前
解決済み
Increment up an input vector
Increment up an input vector by adding the indices to the vector values. For example, if an input vector is [3, 2, 6, 1, 6], the...
8年弱 前
解決済み
Add the odd numbers
Add only the odd numbers of x
example:
x = [1 2 3 4 5]
the positive numbers are: 1 3 5, so their sum is 9
Zero Cross
Write a function that counts the number of times n a signal x changes sign.
Examples
x = [1 2 -3 -4 5 6 -7 8 -9 10 11]
...
8年弱 前
解決済み
Add the even numbers
Add only the even numbers of x
example:
x = [1 2 3 4 5]
the positive numbers are: 2 4, so their sum is 6
8年弱 前
解決済み
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?
8年弱 前
解決済み
Sum of series VI
What is the sum of the following sequence:
Σk⋅k! for k=1...n
for different n?
8年弱 前
解決済み
0, 2, 0, -2, 0, 2, 0, -2, ...
Generate the first n terms of a periodic sequence defined as
f(x) = 0, 2, 0, -2, 0, 2, 0, -2, ..., for x = 1, 2, 3, 4, 5, 6...
angle in regular polygon
Make a function which returns measure of interior angle in x-side regular polygon. x is as input.
Please pay attention, that 1 ...