Range of Values in a Matrix
Create a function that accepts a matrix of real numbers as input and returns the range of the values contained in the matrix. Th...
2年弱 前
解決済み
Draw a 'Z'.
Given _n_ as input, generate a n-by-n matrix like 'Z' by _0_ and _1_ .
Example:
n=5
ans=
[1 1 1 1 1
0 0 0 1 ...
2年弱 前
解決済み
Draw a 'N'!
Given n as input, generate a n-by-n matrix 'N' using 0 and 1 .
Example:
n=5
ans=
[1 0 0 0 1
1 1 0 0 1
1 0 ...
2年弱 前
解決済み
Toeplitz Matrix
For a given square matrix of order n-by-n check whether this is a Toeplitz matrix or not. Return true if it is.
Return the 3n+1 sequence for n
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...
2年弱 前
解決済み
Sum of Two Numbers
Given two integer numbers x and y, calculate their sum and put it in z.
Examples:
Inputs x = 2, y = 4
Output z is 6
...
2年弱 前
解決済み
Create a two dimensional zero matrix
You have to create a zero matrix of size (mxn) whose inputs are m and n and the elements of your matrix should be zeros.
Exam...
2年弱 前
解決済み
Volume of a box
Given a box with a length a, width b, and height c. Solve the volume of the box.
2年弱 前
解決済み
Make a 1 hot vector
Make a vector of length _N_ that consists of all zeros except at index _k_, where it has the value 1.
Example:
Input
...
2年弱 前
解決済み
Matlab Basics - Rounding I
Write a script to round x DOWN to the next lowest integer:
e.g. x = 2.3 --> x = 2 also: x = 2.7 --> x = 2
2年弱 前
解決済み
Who Has the Most Change?
You have a matrix for which each row is a person and the columns represent the number of quarters, nickels, dimes, and pennies t...
Ordinary Annuity : Future Value
Theorem : Future Value of an Ordinary Annuity
where;
F : Future value
A : Periodic payment
r : Rate per period
n : Numbe...