Risolto


Stairs
Make an n by n matrix, where the elements are ones and zeros. In the main diagonal, and under that, there should be only ones (...

quasi 3 anni fa

Risolto


Vectorize the digits of an Integer
Create a vector of length N for an integer of N digits. x = 123045; x_vec = [1 2 3 0 4 5]; I happened upon a trick ...

quasi 3 anni fa

Risolto


execute the declaration in strings and return value
execute the commands in strings and return value input='a=23' output=23

quasi 3 anni fa

Risolto


Alternately upper-lower case
Modify the string to alternate between upper and lower case. For example, s='achyuta' output='AcHyUtA'

quasi 3 anni fa

Risolto


interesting center of magic matrix
output the centre of magic matrix of n input=7; output=25

quasi 3 anni fa

Risolto


most frequent character
Obtain the most frequent character. For example, s='balaram'; output='a'; If there is a tie between letters, return t...

quasi 3 anni fa

Risolto


ascii value
let input='a' output=97

quasi 3 anni fa

Risolto


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

quasi 3 anni fa

Risolto


PIN code II

quasi 3 anni fa

Risolto


Change the sign of even index entries of the reversed vector
change the signs of the even index entries of the reversed vector example 1 vec = [4 -1 -2 9] ans = [9 2 -1 -4] example2...

quasi 3 anni fa

Risolto


Size

quasi 3 anni fa

Risolto


F.R.I.E.N.D.S

quasi 3 anni fa

Risolto


Symmetry of vector
Determine whether the vector is symmetric or not (vector could be even or odd in length). For example: x = [1 2 3 3 2 1] ...

quasi 3 anni fa

Risolto


Sort accordingly

quasi 3 anni fa

Risolto


Insert zeros into vector
Insert zeros after each elements in the vector. Number of zeros is specified as the input parameter. For example: x = [1 ...

quasi 3 anni fa

Risolto


Sum the real and imaginary parts of a complex number
Sum the real and imaginary parts of a complex number. Example c = 1+2i has the solution 1 + 2 = 3

quasi 3 anni fa

Risolto


Determine the length of a string of characters
Determine the length of a string of characters

quasi 3 anni fa

Risolto


Matrix operation

quasi 3 anni fa

Risolto


Matrix multiplication
Multiply two incoming matrices via matrix multiplication

quasi 3 anni fa

Risolto


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

quasi 3 anni fa

Risolto


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

quasi 3 anni fa

Risolto


Vector Multiplication
Vector Multiplication of three matrix as shown in test cases.

quasi 3 anni fa

Risolto


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

quasi 3 anni fa

Risolto


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

quasi 3 anni fa

Risolto


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

quasi 3 anni fa

Risolto


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

quasi 3 anni fa

Risolto


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

quasi 3 anni fa

Risolto


Factorize uniquely! (★★)

quasi 3 anni fa

Risolto


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

quasi 3 anni fa

Risolto


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

quasi 3 anni fa

Carica altro