Community Profile

# chris_gr

Last seen: ein Tag vor Aktiv seit 2020

#### Statistics

Abzeichen anzeigen

#### Content Feed

Anzeigen nach

Gelöst

Write a function man that takes a row vector v and returns a matrix H as follows..
Write a function called man that takes a row vector v as an input and returns a matrix H whose first column consist of the eleme...

2 Monate vor

Gelöst

Go to the head of the class!
You're given a matrix and a single number. If that number is in the matrix, reorder the matrix so that number is in the first r...

2 Monate vor

Gelöst

Replace Nonzero Numbers with 1
Given the matrix x, return the matrix y with non zero elements replaced with 1. Example: Input x = [ 1 2 0 0 0 ...

2 Monate vor

Gelöst

Enlarge array
Given an m-by-n numeric array (A) and a 1-by-2 vector (sz) indicating the dimensions [p q] to enlarge each element, return an (m...

2 Monate vor

Gelöst

Must be in the front row...
You are given a matrix followed by a single number. Your object is to write a script that will shift the matrix around so that ...

2 Monate vor

Gelöst

frame of the matrix
Given the matrix M, return M without the external frame.

2 Monate vor

Gelöst

subtract central cross
Given an n-by-n square matrix, where n is an odd number, return the matrix without the central row and the central column.

2 Monate vor

Gelöst

Given a matrix, swap the 2nd & 3rd columns
If a = [1 2 3 4; 1 2 3 4; 1 2 3 4; 1 2 3 4]; then the result is ans = 1 3 2 4 1 3 2...

2 Monate vor

Gelöst

Inspired by Problem 2008 created by Ziko. In mathematics, the persistence of a number is the *number of times* one must apply...

2 Monate vor

Gelöst

7 segment LED display
Given a whole number, output how many segments would be lit up to display it on a 7 segment LED display (see Wikipedia: http://e...

2 Monate vor

Gelöst

Unique values without using UNIQUE function
You must return unique values in a vector in *stable* mode without using the unique function. About stable order flag: ...

10 Monate vor

Gelöst

Create a vector whose elements depend on the previous element
The idea is to create a vector A whose elements depend on the previous element : *A(i+1) = 2*A(i)+1* *2 Inputs*: - A : The...

10 Monate vor

Gelöst

Calculate the Number of Sign Changes in a Row Vector (No Element Is Zero)
For a row vector: V=[7 1 2 -3] there is one sign change (from 2 to -3). So, the function you write must return N=1. F...

10 Monate vor

Gelöst

Return unique values without sorting
If the input vector A is [42 1 1], the output value B must be the unique values [42 1] The *values of B are in the s...

11 Monate vor

Gelöst

Set the array elements whose value is 13 to 0
Input A either an array or a vector (which can be empty) Output B will be the same size as A . All elements of A equal to 13...

11 Monate vor

Gelöst

Reindex a vector
You are given two vectors of equal length. Vector N has numeric values (no Inf or NaN) while vector IDX has integers. Place th...

11 Monate vor

Gelöst

Fill a zeros matrix
The aim is to fill an array of all zeros given a numerical value and the index of row and columns for this value. 3 Inputs: ...

11 Monate vor

Gelöst

First non-zero element in each column
For a given matrix, calculate the index of the first non-zero element in each column. Assuming a column with all elements zero i...

11 Monate vor

Gelöst

Getting the indices from a matrix
Inspired by Problem 645. Getting the indices from a matrix. Given a matrix A (or a vector), return the indices (always in row...

11 Monate vor

Gelöst

Matrix indexing with two vectors of indices
Given a matrix M and two index vectors a and b, return a row vector x where x(i) = M(a(i),b(i)).

11 Monate vor

Gelöst

intersection of matrices
Given two matrices filled with ones and zeros, determine if they share a common row, column entry. These matrices are of identi...

11 Monate vor

Gelöst

Replicate elements in vectors
Replicate each element of a row vector (with NaN) a constant number of times. Examples n=2, A=[1 2 3] -> [1 1 2 2 3 3] ...

etwa ein Jahr vor

Gelöst

We love vectorized solutions. Problem 1 : remove the row average.
Given a 2-d matrix, remove the row average from each row. Your solution MUST be vectorized. The solution will be tested for ac...

etwa ein Jahr vor

Gelöst

Inner product of two vectors
Find the inner product of two vectors.

etwa ein Jahr vor

Gelöst

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

etwa ein Jahr vor

Gelöst

Create an index-powered vector
Given a input vector x, return y as index-powered vector as shown below. Example x = [2 3 6 9] then y should be [...

etwa ein Jahr vor

Gelöst

Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

etwa ein Jahr vor

Gelöst

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

etwa ein Jahr vor

Gelöst

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

etwa ein Jahr vor

Gelöst

Create an n-by-n null matrix and fill with ones certain positions
The positions will be indicated by a z-by-2 matrix. Each row in this z-by-2 matrix will have the row and column in which a 1 has...

etwa ein Jahr vor