Solved

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.

8 months ago

Solved

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...

8 months ago

Solved

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 = ...

8 months ago

Solved

Pattern Sum

Write a function which receives two single digit positive integers, (k and m) as parameters and calculates the total sum as: k...

8 months ago

Solved

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 ...

8 months ago

Solved

calculate linear convolution two vectors

for e.g in: a = [1 2 3] b = [4 5 6] out: y = [4 13 28 27 18]

8 months ago

Solved

03 - Matrix Variables 6

Make _fMat_ be a 5x3 matrix of random integers with values from -3 to 3 (Hint: use *randi*)

8 months ago

Solved

Flipping

Write code that can reverse the vector without using any sort of loop. Example Given the input vector A = [ 1 2 3 4 5...

8 months ago

Solved

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...

8 months ago

Solved

Determine if a Given Number is a Triangle Number

*Description:* Determine if the elements of an input array are triangle numbers and return the result as an array with the sa...

8 months ago

Solved

Distance walked 3D

suppose you go from x-y-z coordinates [3,4,2] to [0,0,2] to [0,1,2] to [1,1,2], to [1,1,20] then you walked 25 units of distance...

8 months ago

Solved

MATLAB Basic: rounding IV

Do rounding towards plus infinity. Example: -8.8, answer -8 +8.1 answer 9 +8.50 answer 9

8 months ago

Solved

Back to basics - mean of corner elements of a matrix

Calculate the mean of corner elements of a matrix. e.g. a=[1 2 3; 4 5 6; 7 8 9;] Mean = (1+3+7+9)/4 = 5

8 months ago

Solved

Matrix multiplication across rows

Given matrix m, return matrix n such that, rows of n are result of multiplication of the rows of the input matrix Example ...

8 months ago

Solved

Create an index-powered vector

Given a input vector x, return y as index-powered vector as shown below. Example x = [2 3 6 9] then y should be [...

8 months ago

Solved

Volume of a box

Given a box with a length a, width b, and height c. Solve the volume of the box.

8 months ago

Solved

Sum of odd numbers in a matrix

Find the sum of all the odd numbers in a matrix. Example x = [2 3 5 7 1 4 11] y = 27

8 months ago

Solved

All your base are belong to us

Find the base _b_ logarithm of the input decimal number _x_. Express the output as a decimal number. The first argument is the n...

8 months ago

Solved

High school cafeteria

Given an input vector of positive integers, return a row vector with the primes first (in increasing order) and the composites n...

8 months ago

Solved

Number of Even Elements in Fibonacci Sequence

Find how many even Fibonacci numbers are available in the first d numbers. Consider the following first 14 numbers 1 1 2...

8 months ago

Solved

Check if equal

Return true if all the elements of an nD array are equal, false otherwise.

8 months ago

Solved

Is the input divisible by 3?

Return true if the input is divisible by 3 and false if not.

8 months ago

Solved

Convert Fahrenheit to Celsius

Calculate the Celsius temperature C given the Fahrenheit temperature F. Examples: Input F = 90 Output C is 32.22 I...

8 months ago

Solved

Create a Standard Size Vector

Given an input x, create a row vector y from 1 to x with 5 elements.

8 months ago