Solved

Magnitude of a vector (★★★)

Given a vector x with values [ x1, x2, x3, ..., xn ], compute the magnitude (or length) of the vector which is given by <<htt...

10 months ago

Solved

Create logarithmically spaced values (★)

Given three numbers a,b,n with b>a, create a vector y with n logarithmic spaced values between 10^a and 10^b. Thus, if a = -2, ...

10 months ago

Solved

Generate n equally spaced "intervals" between -x and x (★)

Given n and x, return a list of numbers (in ascending order) that divides the interval [-x x] into n equal-length intervals. ...

10 months ago

Solved

Create a vector of the first n odd numbers (★)

If n = 10, your program should return a vector y, where y = [1 3 5 7 9 11 13 15 17 19].

10 months ago

Solved

Doubling elements in a vector (★★)

(copy of prob. 1024) Given the vector A, return B in which all numbers in A are doubling. So for: A = [ 1 5 8 ] t...

10 months ago

Solved

Average of corner elements of a matrix (★★)

(copy of prob 2235) Calculate the average of corner elements of a matrix. e.g. x=[1 2 3; 4 5 6; 7 8 9;] avg = (1+3+7+9)...

10 months ago

Solved

Vector raised to a power, element-wise (★)

Given a vector A and a number x, raise each element of the vector to the power of x. Thus, if A = [2 5 7 1] and x = 0.5, then ...

10 months ago

Solved

Element-wise vector product (★)

Given two vectors x and y, compute their element-wise product z. Thus, if x = [1 3 5] and y = [0.5 -1 2], then z = [1*0.5...

10 months ago

Solved

Generate a vector which contains a pyramid pattern (★★★★)

Generate a vector that contains terms that follows a pyramid pattern up to the nth row: 1 2 2 3 3 3 4 4 4 4 ...

10 months ago

Solved

PEMDAS test (★★)

Create the function that will return the following expression for x and y. <<https://i.ibb.co/RHWyzrv/Code-Cogs-Eqn-1.gif>> ...

10 months ago

Solved

Create a vector of the first n natural numbers (★)

If n = 7, your program should return a vector y, where y = [1 2 3 4 5 6 7].

10 months ago

Solved

Make the vector [1 2 3 4 5 6 7 8 9 10]

In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

10 months ago

Solved

Times 2 - START HERE

Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...

10 months ago