Subtract integers and add doubles
Create a function that subtracts a from b if a and b are integers and adds them if they are floats.
4 years 前
已解决
Compare two input matrices
Check which input matrix has more elements. Return "1" if matrix A has more elements than matrix B. Otherwise return "0".
Exa...
4 years 前
已解决
Sum the 'edge' values of a matrix
Sum the 'edge' values of an input matrix (the values along the perimeter).
Example
[1 2 3
4 5 6
7 8 9]
Output = ...
4 years 前
已解决
Pattern Sum
Write a function which receives two single digit positive integers, (k and m) as parameters and calculates the total sum as:
k...
4 years 前
已解决
Weave two vectors into one
Weave the two given vectors into one as shown below.
Example:
If
a = [1 1 1]
b = [0 0 0]
then
y = [1 0 1 0 ...
Sum of the Matrix Elements
Add up all the elements in a NxM matrix where N signifies the number of the rows and M signifies the number of the columns.
E...