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...
4 years 前
已解决
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, ...
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...
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
...
4 years 前
已解决
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...
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...
4 years 前
已解决
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:...