已解决


System of equations
Find a solution to a system of equations represented by a |n| by |n+1| matrix. For instance, [ 2 0 4; => 2*x = 4 ...

15 years 前

已解决


Snakes on a plane
Given the dimensions of a 2-d plane, create a matrix where a "snake" of ones occupies the plane from top left to bottom right. ...

15 years 前

已解决


Sum the Infinite Series
Given that 0 < x and x < 2*pi where x is in radians, write a function [c,s] = infinite_series(x); that returns with the...

15 years 前

已解决


Back to basics 9 - Indexed References
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix and row and column, output the index of th...

15 years 前

已解决


Similar Triangles - find the height of the tree
Given the height, h1, of a power pole, shorter than a tree, a given distance, x2 away, please find h2, height of the tree. Pleas...

15 years 前

已解决


Indexed Probability Table
This question was inspired by a Stack Overflow question forwarded to me by Matt Simoneau. Given a vector x, make an indexed pro...

15 years 前

已解决


Better bullseye matrix
<http://www.mathworks.com/matlabcentral/cody/problems/18-bullseye-matrix Problem 18> asks to create a bullseye matrix like this:...

15 years 前

已解决


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

15 years 前

已解决


Love triangles
Given a vector of lengths [a b c], determines whether a triangle with non-zero area (in two-dimensional Euclidean space, smarty!...

15 years 前

已解决


Remove all the words that end with "ain"
Given the string s1, return the string s2 with the target characters removed. For example, given s1 = 'the main event' your ...

15 years 前

已解决


All capital?
Are all the letters in the input string capital letters? Examples: 'MNOP' -> 1 'MN0P' -> 0

15 years 前

已解决


Nearest
*Description* Find the value and index of the element in vector _x_ that is nearest to value _y_. _y_ should be able to be a ...

15 years 前

已解决


Right and wrong
Given a vector of lengths [a b c], determines whether a triangle with those sides lengths is a right triangle: <http://en.wikipe...

15 years 前

已解决


Reverse Run-Length Encoder
Given a "counting sequence" vector x, construct the original sequence y. A counting sequence is formed by "counting" the entrie...

15 years 前

已解决


radius of a spherical planet
you just measured its surface area, that is the input.

15 years 前

已解决


Counting Money
Add the numbers given in the cell array of strings. The strings represent amounts of money using this notation: $99,999.99. E...

15 years 前

已解决


Angle of triangle
For three unknown points a b c, given three sides ab bc ca, find three angles abc bca cab in radians. Your function should b...

15 years 前

已解决


Roll the Dice!
*Description* Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. *Example* [x1,x2] =...

15 years 前

已解决


Tricky timing
Write a function that takes between 0.5 seconds and 0.6 seconds to run.

15 years 前

已解决


Word Counting and Indexing
You are given a list of strings, each being a list of words divided by spaces. Break the strings into words, then return a maste...

15 years 前

已解决


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 (http://en.wikipedia.org...

15 years 前

已解决


Circumscribed circles
Given the lengths of the 3 sides of a triangle, output the radius of the circumscribed circle. Example: [3 4 5] -> 2.5

15 years 前

已解决


Cannon Ball
Given g (acceleration due to gravity) and desired altitude x, find the minimum ground velocity of a cannon ball to reach x.

15 years 前

已解决


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

15 years 前

已解决


2 b | ~ 2 b
Given a string input, output true if there are 2 b's in it, false if otherwise Examples: 'Macbeth' -> false 'Publius Cor...

15 years 前

已解决


Mechanics 1
I thought I would make a mechanics problem for all those physics lovers out there. Imagine two solid, rigid spheres B1 and B...

15 years 前

已解决


Count from 0 to N^M in base N.
Return an array of numbers which (effectively) count from 0 to N^M-1 in base N. The result should be returned in a matrix, with ...

15 years 前

已解决


Pattern matching
Given a matrix, m-by-n, find all the rows that have the same "increase, decrease, or stay same" pattern going across the columns...

15 years 前

已解决


The Goldbach Conjecture, Part 2
The <http://en.wikipedia.org/wiki/Goldbach's_conjecture Goldbach conjecture> asserts that every even integer greater than 2 can ...

15 years 前

已解决


High school cafeteria
Given an input vector of positive integers, return a row vector with the primes first (in increasing order) and the composites n...

15 years 前

加载更多