Community Profile

# yuval tr

Active since 2012

#### Statistics

• • • #### Content Feed

View by

Solved

The Answer to Life, the Universe, and Everything
A variation of a previous Hitchhiker's Guide to the Galaxy problem. *Inputs:* Life, the Universe, and Everything *Output:*...

etwa 8 Jahre ago

Solved

Specific Element Count
Given a vector _v_ and a element _e_, return the number of occurrences of _e_ in _v_. Note: NaNs are equal and there may be n...

etwa 8 Jahre ago

Solved

Replace multiples of 5 with NaN
It is required to replace all values in a vector that are multiples of 5 with NaN. Example: input: x = [1 2 5 12 10 7] ...

etwa 8 Jahre ago

Solved

middleAsColumn: Return all but first and last element as a column vector
Given input A, return all but the first and last elements, arranged as a column vector. (I.e., all dimensions after the first s...

etwa 8 Jahre ago

Solved

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

etwa 8 Jahre ago

Solved

Spot the outlier
All points except for one lie on a line. Which one is the outlier? Example: You are given a list of x-y pairs in a column ...

etwa 8 Jahre ago

Solved

Who is the smartest MATLAB programmer?
Who is the smartest MATLAB programmer? Examples: Input x = 'Is it Obama?' Output = 'Me!' Input x = 'Who ?' Ou...

etwa 8 Jahre ago

Solved

Find a subset that divides the vector into equal halves
Given a vector x, return the indices to elements that will sum to exactly half of the sum of all elements. Example: Inpu...

etwa 8 Jahre ago

Solved

Getting logical indexes
This is a basic MATLAB operation. It is for instructional purposes. --- Logical indexing works like this. thresh = 4...

etwa 8 Jahre ago

Solved

Calculate the sum of two numbers. Example input = [2 3] output = 5

etwa 8 Jahre ago

Solved

Find max
Find the maximum value of a given vector or matrix.

etwa 8 Jahre ago

Solved

Make a 1 hot vector
Make a vector of length _N_ that consists of all zeros except at index _k_, where it has the value 1. Example: Input ...

etwa 8 Jahre ago

Solved

Matrix which contains the values of an other matrix A at the given locations.
If you have two matrices, which together give xc and yc coordinates into another matrix, eg : xc = [1 1 1; 2 2 1]; ...

etwa 8 Jahre ago

Solved

Make a run-length companion vector
Given a vector x, return a vector r that indicates the run length of any value in x. Each element in r shows how many times the ...

etwa 8 Jahre ago

Solved

Generate a vector like 1,2,2,3,3,3,4,4,4,4
Generate a vector like 1,2,2,3,3,3,4,4,4,4 So if n = 3, then return [1 2 2 3 3 3] And if n = 5, then return [1 2 2...

etwa 8 Jahre ago

Solved

Duplicate each element of a vector.
for an n-dimensional vector x, the function should return another vector 2n-dimension which each element is repeated twice. Ex...

etwa 8 Jahre ago

Solved

Given a window, how many subsets of a vector sum positive
Given a vector: [1 0 -1 3 2 -3 1] and a window of 2, A sliding window would find: 1 + 0 = 1 0 - 1 = -1 ...

etwa 8 Jahre ago

Solved

Ackermann's Function
Ackermann's Function is a recursive function that is not 'primitive recursive.' <http://en.wikipedia.org/wiki/Ackermann_fun...

fast 9 Jahre ago

Solved

Back to basics 25 - Valid variable names
Covering some basic topics I haven't seen elsewhere on Cody. Given a string, return true if it is a valid MATLAB variable nam...

fast 9 Jahre ago

Solved

Summing Digits within Text
Given a string with text and digits, add all the numbers together. Examples: Input str = '4 and 20 blackbirds baked in a...

fast 9 Jahre ago

Solved

Back to basics 26 - Keywords
Covering some basic topics I haven't seen elsewhere on Cody. Return a cell array of strings of all MATLAB keywords.

fast 9 Jahre ago

Solved

Back to basics 14 - Keywords
Covering some basic topics I haven't seen elsewhere on Cody. Return a cell array of all MATLAB keywords

fast 9 Jahre ago

Solved

Make a random, non-repeating vector.
This is a basic MATLAB operation. It is for instructional purposes. --- If you want to get a random permutation of integer...

fast 9 Jahre ago

Solved

Back to basics 13 - Input variables
Covering some basic topics I haven't seen elsewhere on Cody. Return as a string the name of the input variable to the functio...

fast 9 Jahre ago

Solved

Find the two-word state names
Given a list of states, remove all the states that have two-word names. If s1 = 'Alabama Montana North Carolina Vermont N...

fast 9 Jahre ago

Solved

Calculate euler's phi function

fast 9 Jahre ago

Solved

Get the elements of diagonal and antidiagonal for any m-by-n matrix
In the problem <http://www.mathworks.com/matlabcentral/cody/problems/858-permute-diagonal-and-antidiagonal Problem 858. Permute ...

fast 9 Jahre ago

Solved

Wrapping the Tower of Pisa
The famous artist Christo Vladimirov Javacheff, who likes pizza, wants to wrap the well-known Italian tower in paper. It is a ci...

fast 9 Jahre ago

Solved

Cody Computer Part 2 - Get the license number of Cody Computer
In the Cody computer investigation party, you may have already solved : <http://www.mathworks.com/matlabcentral/cody/problems...

fast 9 Jahre ago

Solved

Cody Computer Part 1 - Guess the system font used by uipanel
list = listfonts return the list of available system fonts. Can you guess which font is used for uipanel on the CODY computer...

fast 9 Jahre ago