解決済み


Fermat's Last Theorem - Fermat's conjecture
Fermat's Last Theorem (sometimes called Fermat's conjecture, especially in older texts) states that no three positive integers a...

13年弱 前

解決済み


Find the definite integral of various linear functions
A definite integral had a minimum and maximum limit. When you solve this type of problem you must use both quad and the trapz fu...

13年弱 前

解決済み


Creating a s-function for RTW
I need to create a simulink block that will behave differently depending on whether I am simulating the model or building code. ...

13年弱 前

解決済み


Find the stride of the longest skip sequence
We define a _skip sequence_ as a regularly-spaced list of integers such as might be generated by MATLAB's <http://www.mathworks....

13年弱 前

解決済み


Calculate the nth Fibonacci number USING 'Golden Ratio' concept
f = [1 1 2 3 5 8 13 ...] If n=6, f(6)=8

13年弱 前

解決済み


Guess the Coefficients!
Given a polynomial _p_ known to have positive integer coefficients, deduce the values of the coefficients. For example: ...

13年弱 前

解決済み


chirp again
rise frequency linearly from 0 to frequency f in 1 second and fs samples, initial amplitude must rise smoothly like an aircraft ...

13年弱 前

解決済み


Polynomial division
Divide a polynomial u by polynomial v and return the quotients only. Example: u = x^4+3*x^3+5*x+3 v = x^2+1 Answer: ...

13年弱 前

解決済み


Determine if input is a Narcissistic number
<http://en.wikipedia.org/wiki/Narcissistic_number Narcissistic number> is a number that is the sum of its own digits each raised...

13年弱 前

解決済み


Decimal Comparison
*Background* A utility of particular interest to Cody and other MATLAB ventures is comparing the equality of two numbers. In ...

13年弱 前

解決済み


Find the elements of a matrix according to a defined property.
From A = [5,2,3] and B = [1,2,3,4,5,6,7,8,9,10] produce a vector C where : C(1) is the sum of the first A(1) elements of B, ...

13年弱 前

解決済み


How many jokers?
* Given DNA codes of a group of suspects, * and a code for certain types of jokers, * Count how many jokers of that type. * ...

13年弱 前

解決済み


Generate the Matrix!
Given n, generate the following matrix: a = [ n n-1 n-2 ... 2 1; n-1 n-1 n-2 ... 2 1; n-2 n-2 n-2 ... 2 1;...

13年弱 前

解決済み


Decimation
When dealing to the Roman Army, the term decimate meant that the entire unit would be broken up into groups of ten soldiers, and...

13年弱 前

解決済み


Josephus Survivor
The <http://en.wikipedia.org/wiki/Josephus_problem Josephus Challenge> is to find the position that is the last remaining when e...

13年弱 前

解決済み


Solve Quadratic : No * - or key functions permitted
Solve the quadratic equation *ax^2+bx+c=0*. However, some of the normal functions and symbols are not allowed. x=[ -b +/- sq...

13年弱 前

解決済み


Without french accent please !
Suppress french accent For example 'Déjà présent' -> 'Deja present'

13年弱 前

解決済み


Create incremental spiral WITHOUT USING EVAL or FEVAL
Constructions that use feval or eval are used to cheat with cody. This test-suite tries to avoid that trick. The goal of this...

13年弱 前

解決済み


Get ranks of values in a vector
For a given vector, say [6 3 8 2], return the ranks (ascending) of observations, i.e. [3 2 4 1]. Do not worry about tied ranks. ...

13年弱 前

解決済み


A different counting method
Given an array (x) of integers, the "counting" array (y) is showing the number of identical consecutive integers in x in front o...

13年弱 前

解決済み


"Look and say" sequence
What's the next number in this sequence? * [0] * [1 0] * [1 1 1 0] * [3 1 1 0] * [1 3 2 1 1 0] This a variant on the w...

13年弱 前

解決済み


Project Euler: Problem 16, Sums of Digits of Powers of Two
2^15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26. What is the sum of the digits of the number 2^N? Thanks ...

13年弱 前

解決済み


Multielement indexing of a row array
The row array birthRateChina stores the China birth rate (per 1000 people) for years 2000 to 2012. Write a statement that create...

13年弱 前

解決済み


Create a row array using double colon operator
Create a row array from 9 to 1, using the double colon operator.

13年弱 前

解決済み


Lightning strike distance: Writing a function
Write a function named LightningDistance that outputs "distance" given input "seconds". Seconds is the time from seeing lightnin...

13年弱 前

解決済み


Pizza value using expression with parentheses
Pizza prices are typically listed by diameter, rather than the more relevant feature of area. Compute a pizza's value (cost per ...

13年弱 前

解決済み


Circle area using pi
Given a circle's radius, compute the circle's area. Use the built-in mathematical constant pi.

13年弱 前

解決済み


Fahrenheit to Celsius using multiple statements
Given a Fahrenheit value F, convert to a Celsius value C. While the equation is C = 5/9 * (F - 32), as an exercise use two state...

13年弱 前

解決済み


Simple equation: Annual salary
Given an hourly wage, compute an annual salary by multiplying the wage times 40 and times 50, because salary = wage x 40 hours/w...

13年弱 前

解決済み


Symmetric matrix
You must create a n-by-n *symmetric* matrix such that A(row,col) = row/col for col >= row. Example if n =3 : output is : ...

13年弱 前

さらに読み込む