Create a square matrix of multiples
Given an input, N, output a matrix N x N with each row containing multiples of the first element of each row.
This also applies...
Draw 'H'
Draw a x-by-x matrix 'H' using 1 and 0. (x is odd and bigger than 2)
Example:
x=5
ans=
[1 0 0 0 1
1 0 0 0 1
...
3 years ago
Solved
Simple Interest : Calculate Present Value
Theorem : Simple Interest
where;
F : Future Value
P : Present Value
r : Annual simple interest rate (decimal)
t : Time in...
3 years ago
Solved
Sequence
Let S be a sequence of numbers
Let
Find for some , where and .
Update - test suite cleaned up on 2-9-22
3 years ago
Solved
Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1.
Hint: use increment.
3 years ago
Solved
Doubling elements in a vector
Given the vector A, return B in which all numbers in A are doubling. So for:
A = [ 1 5 8 ]
then
B = [ 1 1 5 ...
3 years ago
Solved
Create a vector
Create a vector from 0 to n by intervals of 2.
3 years ago
Solved
Flip the vector from right to left
Flip the vector from right to left.
Examples
x=[1:5], then y=[5 4 3 2 1]
x=[1 4 6], then y=[6 4 1];
Request not ...
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...