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...
First non-zero element in each column
For a given matrix, calculate the index of the first non-zero element in each column. Assuming a column with all elements zero ...
mehr als 4 Jahre vor
Gelöst
Summing digits
Given n, find the sum of the digits that make up 2^n.
Example:
Input n = 7
Output b = 11
since 2^7 = 128, and 1 + ...
mehr als 4 Jahre vor
Gelöst
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:...