Gelöst


Variance computation (★)
Given a vector x with several values, compute the variance, whose formula is given by: <<https://i.imgur.com/Wg95KBE.gif>> ...

etwa ein Jahr vor

Gelöst


Replicate elements in vectors (★★★)
(copy of Prob 867) Replicate each element of a row vector (with NaN) a constant number of times. Examples n=2, A=[1 2...

etwa ein Jahr vor

Gelöst


Stacking vectors into a matrix
Given a 4x1 vector a, and a 2x2 matrix b, create a matrix M in which the first 2 rows are each identical to a and the last two r...

etwa ein Jahr vor

Gelöst


Create a vector with n repeated values of a number x (★★)
If x=3 and n=7 then the vector y would be y=[3 3 3 3 3 3 3]

etwa ein Jahr vor

Gelöst


Approximate functions 1 (★★★)
Compute the following sum for any given x and positive integer n. <<https://i.imgur.com/eUwXdSE.gif>> <> Here m! denote...

etwa ein Jahr vor

Gelöst


Sum of terms in a series 1 (★★★)
Given x and n, compute the following sum: |x|+|x|^(1/2)+|x|^(1/3)+|x|^(1/4)+|x|^(1/5) ... + |x|^(1/n) where ||x|| indica...

etwa ein Jahr vor

Gelöst


Function 1 (★)
Compute the value of <<https://i.imgur.com/AxKWLmE.gif>> for any given positive x.

etwa ein Jahr vor

Gelöst


Get the elements of diagonal and antidiagonal for any m-by-n matrix (★★★★)
(copy of prob. 859) In this problem you must submit a solution which returns the diagonal and anti-diagonal elements without ...

etwa ein Jahr vor

Gelöst


How to locate the position of an element in a vector without using the find function
(copy of prob 105 with test for find function) Write a function posX = *locatePos* (x,y) which returns the location o...

etwa ein Jahr vor

Gelöst


Sum of elements of a vector (★★★)
Given any vector x = [x1, x2, x3, ... xn], compute the sum of its elements. Thus, if x = [ 1 3 -2 5 ], then the sum of its el...

etwa ein Jahr vor

Gelöst


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

etwa ein Jahr vor

Gelöst


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

etwa ein Jahr vor

Gelöst


Median computation (★★★)
See easy edition of this problem. However, now you must compute the median of any real-valued vector without using the in-built...

etwa ein Jahr vor

Gelöst


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

etwa ein Jahr vor

Gelöst


Create a vector of n alternating ones and zeros (★★)
Given n, your output should be a vector y of numbers such that the first number is 1 and the numbers following it alternate betw...

etwa ein Jahr vor

Gelöst


Vector creation using linspace
Create a vector y containing n uniformly spaced values between a and b, with a < b. Use linspace.

etwa ein Jahr vor

Gelöst


Triangle Numbers (★★)
(copy of problem 5) Triangle numbers are the sums of successive integers. So 6 is a triangle number because 6 = 1 + 2 + 3...

etwa ein Jahr vor

Gelöst


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

etwa ein Jahr vor

Gelöst


Vector creation using colon operator
Create a vector y containing n uniformly spaced values between a and b, with a < b. Use the colon (:) operator.

etwa ein Jahr vor

Gelöst


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

etwa ein Jahr vor

Gelöst


Sum of terms in a series 2 (★★★)

etwa ein Jahr vor

Gelöst


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

etwa ein Jahr vor

Gelöst


Select every other element of a vector (★★)
(copy of prob 6) Write a function which returns every other element of the vector passed in. That is, it returns the all odd-...

etwa ein Jahr vor

Gelöst


Median computation (★)
Given a vector of values, compute the median. The median is defined as the middle value in a set of *sorted* data. Thus, if ...

etwa ein Jahr vor

Gelöst


Remove the row average (★★★)
(copy of Prob. 963) Given a 2-d matrix, remove the row average from each row. Your solution MUST be vectorized. The solut...

etwa ein Jahr vor

Gelöst


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

etwa ein Jahr vor

Gelöst


Swap the first and last columns (★★)
(copy of Prob 19) Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becom...

etwa ein Jahr vor

Gelöst


Sum of elements in a vector (★)
(copy of Prob. 3) Find the sum of all the numbers of the input vector x. Input x = [1 2 3 5] Output y is 11 <> ...

etwa ein Jahr vor

Gelöst


Make a checkerboard matrix (★★★★★)
(copy of Prob. 4) Given an integer n, make an n-by-n matrix made up of alternating ones and zeros as shown below. The a(1...

etwa ein Jahr vor

Mehr laden