Resuelto


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

casi 12 años hace

Resuelto


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.

casi 12 años hace

Resuelto


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

casi 12 años hace

Resuelto


Find: Faster Alternatives for Large Sorted/Unique Vectors
The Challenge is to create faster Find methods for large unique ascending vectors. Methods exist that are 1000 times faster t...

casi 12 años hace

Resuelto


Check if number exists in vector
Return 1 if number _a_ exists in vector _b_ otherwise return 0. a = 3; b = [1,2,4]; Returns 0. a = 3; b = [1,...

casi 12 años hace

Resuelto


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

casi 12 años hace

Resuelto


Back to basics 11 - Max Integer
Covering some basic topics I haven't seen elsewhere on Cody. Return the largest positive integer MATLAB can handle.

casi 12 años hace

Resuelto


Remove NaN ?
input -> matrix (n*m) with at least one element equal to NaN; output -> matrix(p*m), the same matrix where we deleted the enti...

casi 12 años hace

Resuelto


Counting Sequence
Given a vector x, find the "counting sequence" y. A counting sequence is formed by "counting" the entries in a given sequence...

casi 12 años hace

Resuelto


Back and Forth Rows
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 wind back and forth along the rows as shown in the...

casi 12 años hace

Resuelto


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

alrededor de 12 años hace

Resuelto


Multiply 2 numbers
Very easy, you just have to multiply 2 numbers but you cannot use the following signs (*, /, - ,^) ,mtimes , times, cross, pro...

alrededor de 12 años hace

Resuelto


Back to basics 15 - Benchmark
Covering some basic topics I haven't seen elsewhere on Cody. Return an array of the benchmark values for MATLAB.

alrededor de 12 años hace

Resuelto


Multiply a column by a row
* Given a column vector C and and a row vector R. * Output a matrix M. * Every column of M equals to C multiplied by correspon...

alrededor de 12 años hace

Resuelto


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

alrededor de 12 años hace

Resuelto


Find number of days
The input is two date in string format (dd-mm-yyyy) find out the number of days between these two dates. Example: input: ...

alrededor de 12 años hace

Resuelto


Replace Vector Elements
Replace all elements in a vector which are equal to or smaller than zero with 0.1. Example: A = [1 2 3 -1 0 2 -3 -80]; ...

alrededor de 12 años hace

Resuelto


Return the Nth Output from an Input Command
*Description* Given _F_, a cell array whose first element is a function handle and subsequent elements are arguments, return ...

alrededor de 12 años hace

Resuelto


Remove white space from the string
Remove the white spaces (trailing and leading) from the input variable

alrededor de 12 años hace

Resuelto


Most nonzero elements in row
Given the matrix a, return the index r of the row with the most nonzero elements. Assume there will always be exactly one row th...

alrededor de 12 años hace

Resuelto


Return the first and last character of a string
Return the first and last character of a string, concatenated together. If there is only one character in the string, the functi...

alrededor de 12 años hace

Resuelto


Remove NaNs and numbers adjacent to NaNs
The aim is to remove the elements before and after NaN occurrences inside a vector. For example: x = [6 10 5 8 9 NaN 23 1...

alrededor de 12 años hace

Resuelto


Remove the two elements next to NaN value
The aim is to *remove the two elements next to NaN values* inside a vector. For example: x = [6 10 5 8 9 NaN 23 9 7 3 21 ...

alrededor de 12 años hace

Resuelto


Convert a structure into a string
Convert the contents of each fields into a string. Example with an input structure s with 2 fields : s.age = '33' s....

alrededor de 12 años hace

Resuelto


Sort an array of structures
You need to sort an array of structures based upon *a numeric first field*: For example : a.n=1; a.name='a'; b.n=3...

alrededor de 12 años hace

Resuelto


Maximum running product for a string of numbers
Given a string s representing a list of numbers, find the five consecutive numbers that multiply to form the largest number. Spe...

alrededor de 12 años hace

Resuelto


Remove any row in which a NaN appears
Given the matrix A, return B in which all the rows that have one or more <http://www.mathworks.com/help/techdoc/ref/nan.html NaN...

alrededor de 12 años hace

Resuelto


Increment a number, given its digits
Take as input an array of digits (e.g. x = [1 2 3]) and output an array of digits that is that number "incremented" properly, (i...

alrededor de 12 años hace

Resuelto


Compute a dot product of two vectors x and y
x and y are input vectors, d is a number and contains their dot product

alrededor de 12 años hace

Resuelto


Make blocks of color
Given a (Nx3) sequence of RGB colors, I want to create a (numRowBlocks x numColBlocks x 3) image comprising (blockSize x blockSi...

alrededor de 12 años hace

Cargar más