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...
3年弱 前
解決済み
Back to basics 19 - character types
Covering some basic topics I haven't seen elsewhere on Cody.
Return the number of punctuation characters in the input variabl...
Add two numbers
Calculate the sum of two numbers.
Example
input = [2 3]
output = 5
3年弱 前
解決済み
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".
Check if sorted
Check if sorted.
Example:
Input x = [1 2 0]
Output y is 0
3年弱 前
解決済み
Fibonacci-Sum of Squares
Given the Fibonacci sequence defined by the following recursive relation,
* F(n) = F(n-1) + F(n-2)
* where F(1) = 1 and F(1)...
3年弱 前
解決済み
Alternating sum
Given vector x, calculate the alternating sum
y = x(1) - x(2) + x(3) - x(4) + ...