已解决


root?
* Given a function 'foo', and a position 'there', find the root near 'there'. * For example: If foo=@sin, and there=3.1, then r...

11 years 前

已解决


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

11 years 前

已解决


Back to basics 24 - Symbolic variables
Covering some basic topics I haven't seen elsewhere on Cody. Given a string algebraic expression, return the symbolic variabl...

11 years 前

已解决


does it touch ?
given a sentence, tell how much it touches. input : string output : how much it touches touching : a bilabial phoneme d...

11 years 前

已解决


Solitaire Cipher
Implement the <http://en.wikipedia.org/wiki/Solitaire_(cipher) solitaire cipher>. Since this is from Wikipedia, I am capturin...

11 years 前

已解决


How long is the longest prime diagonal?
Stanislaw Ulam once observed that if the counting numbers are <http://en.wikipedia.org/wiki/Ulam_spiral arranged in a spiral>, t...

11 years 前

已解决


Find the biggest empty box
You are given a matrix that contains only ones and zeros. Think of the ones as columns in an otherwise empty floor plan. You wan...

11 years 前

已解决


It's race time! Write a faster function than the test suite call of unique().
Write a function to get unique elements of a vector faster than unique()! Input will be a vector (of integers or floating point ...

11 years 前

已解决


create a circulant matrix
create a circulant matrix

11 years 前

已解决


Determine the number of odd integers in a vector
Determine the number of unique odd integers in a vector. Examples: Input x = [2 5 8 3 7 1]; Output y = 4; Inp...

11 years 前

已解决


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

11 years 前

已解决


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] n=0...

11 years 前

已解决


Function composition
Write a function that accepts two function handles f and g and returns the composition h. That is, h = (f o g)(x) = f(g(x)) ...

11 years 前

已解决


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

11 years 前

已解决


Back to basics 2 - Function Path
Covering some basic topics I haven't seen elsewhere on Cody. Given a string that is the name of a MATLAB function, return a s...

11 years 前

已解决


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

11 years 前

已解决


Non-zero bits in 10^n.
Given an integer that is a power of 10, find the number of non-zero bits, k, in its binary representation. For example: * ...

11 years 前

已解决


Generate a random matrix A of (1,-1)
Input n: is an positive integer which serves as the dimension of the matrix A; Output: A=(Aij),where each entry Aij is either...

11 years 前

已解决


Output any real number that is neither positive nor negative
Output any real number that is neither positive nor negative

11 years 前

已解决


Create an 'arrow-head" matrix
Write a function that when given an odd number, produces an arrow-head function pointing to the right. Examples n = 3 ...

11 years 前

已解决


Reference Index Number
Given a reference set R of elements (each unique but identical in type), and a list V of elements drawn from the set R, possibly...

11 years 前

已解决


Prime Time
All you need to do here is submit your solution a prime number of seconds after the top of the hour. Any hour at all... Easy, ...

11 years 前

已解决


Angles of the hands of a clock
For this problem, consider an analog (or at least continuous digital representation) of a clock. Our clock is a 12 hour clock w...

11 years 前

已解决


Phonebook-like problem
strcmpi('Yes', 'No')

11 years 前

已解决


Count up then down
Create a function that produces counting up from 0 up to n then down to 0 n=2 --> 0 1 2 1 0 n=3 --> ...

11 years 前

已解决


ASCII art
Convert a grayscale image to ASCII <<http://www.alfnie.com/software/cameraman.jpg>> *Inputs:* * *img*: Grayscale imag...

11 years 前

已解决


Simple Decoder Ring
The stereotypical _decoder ring_ is remembered as a cereal box prize from the 1950s. Kids learned about cryptography by startin...

11 years 前

已解决


FizzBuzz
<http://c2.com/cgi/wiki?FizzBuzzTest FizzBuzz Test> The "Fizz-Buzz test" is an interview question designed to help filter out...

11 years 前

已解决


Knights and Knaves (part 3)
_This is a Matlab adaptation of the_ <http://en.wikipedia.org/wiki/Knights_and_Knaves Knives and Knaves> _logical puzzles_. ...

11 years 前

已解决


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

11 years 前

加载更多