Vector with a repeated entry
Create a row vector of length n, filled with 4's. For example, if n = 3,
output = [4 4 4]
Hint:
Search for the function...
4年弱 前
解決済み
Log of a number
Write a script that will give the log of x as output.
4年弱 前
解決済み
Sum of 2 numbers in array
Given an array and a target sum, return true if any 2 numbers in the array sum up to the given target sum. Both numbers cannot h...
4年弱 前
解決済み
Diagonal & Anti-Diagonal Matrix: Easy
Create a matrix as shown below from "magic" square.
For example:
if input x=9;then use mgic(x) and create the matrix...
4年弱 前
解決済み
Find x in provided equation!
x^2-2*x+1=0
This polynomial can be expressed by using each term's coefficients, such as
[1 -2 1].
Using the polynomial ...
Higher! Lower!
My kids have started to play the "I'm thinking of a number between X and Y" game in the car on trips to and from their swim less...
4年弱 前
解決済み
Self-similarity 2 - Every third term
Self-similar integer sequences are certain sequences that can be reproduced by extracting a portion of the existing sequence. Se...
The 5th Root
Write a function to find the 5th root of a number.
It sounds easy, but the typical functions are not allowed (see the test su...
4年弱 前
解決済み
Double Fibonacci
double_fibonacci takes two integers, each greater than one, as input arguments (it does not have to check the format of the inpu...
4年弱 前
解決済み
Multiply binary numbers
Write a function to multiply two binary numbers input as strings. For example, input values of ‘1011’ and ‘101’ should give ’110...