Resuelto


Prime number check (★★)
One way to see if a number x is prime is to compute the remainders obtained when dividing x by all integers from 2 to √(x). If x...

más de 3 años hace

Resuelto


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

más de 3 años hace

Resuelto


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

más de 3 años hace

Resuelto


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

más de 3 años hace

Resuelto


Create times-tables (★★★)
(copy of prob 33) At one time or another, we all had to memorize boring times tables. 5 times 5 is 25. 5 times 6 is 30. 12 ti...

más de 3 años hace

Resuelto


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

más de 3 años hace

Resuelto


Sum of adjacent elements in a vector
Given a vector v, return a vector s containting the sum of every two adjacent elements in the vector. Every element s(i) cont...

más de 3 años hace

Resuelto


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

más de 3 años hace

Resuelto


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

más de 3 años hace

Resuelto


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]

más de 3 años hace

Resuelto


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

más de 3 años hace

Resuelto


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

más de 3 años hace

Resuelto


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

más de 3 años hace

Resuelto


Column Removal (★★★)
(copy of prob 7) Remove the nth column from input matrix A and return the resulting matrix in output B. So if A = [1 2...

más de 3 años hace

Resuelto


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

más de 3 años hace

Resuelto


Longest run of consecutive numbers (★★★★★)
(copy of Problem 672) Given a vector a, find the number(s) that is/are repeated consecutively most often. For example, if you...

más de 3 años hace

Resuelto


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

más de 3 años hace

Resuelto


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

más de 3 años hace

Resuelto


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

más de 3 años hace

Resuelto


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

más de 3 años hace

Resuelto


Reindex a vector (★★)
(copy of Prob. 676) You are given two vectors of equal length. Vector N has numeric values (no Inf or NaN) while vector IDX h...

más de 3 años hace

Resuelto


Factorize uniquely! (★★)

más de 3 años hace

Resuelto


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

más de 3 años hace

Resuelto


Vector of digits (★★)
Given a positive integer x, construct a vector y with all the digits of x in the order of appearance in x. Thus, if x = 172...

más de 3 años hace

Resuelto


Matrix with increasing numbers (★★★★)

más de 3 años hace

Resuelto


Approximate functions 2 (★★★★)

más de 3 años hace

Resuelto


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

más de 3 años hace

Resuelto


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.

más de 3 años hace

Resuelto


Logarithmically spaced vector creation using logspace
Create a vector y containing n logarithmically spaced values between a and b, with a < b. Use the logspace operator.

más de 3 años hace

Resuelto


Matrix Construction I
Given n, construct a matrix as shown in the example below. Example For n=8, the output should look like this: 1 2 3 4 ...

más de 3 años hace

Cargar más