Resuelto


index of n in magic(n)
let input=5; magic matrix 17 24 1 8 15 23 5 7 14 16 4 6 13 20 22 ...

más de 9 años hace

Resuelto


Matlab Basics II - Intervals
Write a function that takes an interval from a to b, and divides it into 5 parts example: a = 1, b = 2 output = 1 1.25 ...

más de 9 años hace

Resuelto


Matlab Basics - Logical Tests I
Write a script to test whether a year number is for a leap year or not. eg. x = 1884 output = 1 eg. x = 3 output = 0

más de 9 años hace

Resuelto


Project Euler: Problem 3, Largest prime factor
The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number being input, input might be ui...

más de 9 años hace

Resuelto


Make a Star Pyramid
Create a star pyramid. First line will have 1 star, second will have two stars and so on... a basic program which is easily done...

más de 9 años hace

Resuelto


Matlab Basics II - Free Fall
An object freely falling from rest under gravity covers a distance x given by: x = 1/2 gt^2 write a function that calculat...

más de 9 años hace

Resuelto


Put Two 1D matrices into one 1D matrix
Example: If input a = [1 2 3 4 5]; input b = [10 9 8 7 6]; then output will be, y_correct = [1 10 2 9 3 8 4 7 5...

más de 9 años hace

Resuelto


Find the position of first minimum value in an integer array with numbers
If x = [2 6 4 9 10 3 1 5 1] the the output should be 7, because the first minimum value (1) lies at the 7th position.

más de 9 años hace

Resuelto


Matrix rotation as per given angle
Given a user defined matrix and angle of rotation, rotate the elements of output matrix as clockwise or anti-clockwise. Angle wi...

más de 9 años hace

Resuelto


Integer or Float?
Test an input to see whether it is an integer or a floating point number. If it is an integer return 1 for 'true'. Otherwise ret...

más de 9 años hace

Resuelto


Pull the variable y_correct from the Caller's Workspace
*Description* This highlights a very easy to use and high-scoring cheat that can be used on almost all Cody questions.

más de 9 años hace

Resuelto


Implement a counter
Write a function that returns a function that counts the number of times it is invoked. Example: >> h = counter; >> h() ...

más de 9 años hace

Resuelto


Beginner's Problem - Squaring
Try out this test problem first. Given the variable x as your input, square it by two and put the result in y. Examples: ...

más de 9 años hace

Resuelto


Guess Cipher
Guess the formula to transform strings as follows: 'Hello World!' --> 'Ifmmp Xpsme!' 'Can I help you?' --> 'Dbo J ifmq zpv...

más de 9 años hace

Resuelto


Subtract two positive numbers
Given a and b as a string, return b-a without using string to number conversion functions. a and b must to be a same size and b ...

más de 9 años hace

Resuelto


Array GCD
* Find Greatest Common Divisor in a given array * Function Template: function ans = arraygcd(a) % a=[45 15 200 ...

más de 9 años hace

Resuelto


Wheat on a chessboard pt 1
If a chessboard were to have wheat placed upon each square such that one grain were placed on the first square and each successi...

más de 9 años hace

Resuelto


Palindrome Check
Check whether the entire matrix is palindrome or not. Example matrix = [7 8 7] matrix_reverse = [7 8 7] So the mat...

más de 9 años hace

Resuelto


Let's get back to school, and create multiplication tables
For a given range, create multiplication tables. (start is always < endno) Example start = 17 endno = 19 Then, ...

más de 9 años hace

Resuelto


Wilf-Zeilberger pairs
Take as inputs two functions _F_ and _G_, and two scalar values _n_ and _k_. Test whether the functions are candidates to be a W...

más de 9 años hace

Resuelto


Filter values in a vector
Cody often benefits from a functional style of programming. For example, your score is often better when you compose multiple fu...

más de 9 años hace

Resuelto


Community Problem 500!
In honor of this being the 500th Community problem, see if you can create a function that has a Cody size of 500. It can do any...

más de 9 años hace

Resuelto


Add 7
Given an input variable x, output a variable y that is 7 greater than x. Example: Input x = 1 Output y is 8 Input ...

más de 9 años hace

Resuelto


How long do each of the stages of the rocket take to burn?
A space rocket has 3 stages: - stage 1, s1; - stage 2, s2; - stage 3, s3. If s1 burns 3 x as long as s2 which burns ...

más de 9 años hace

Resuelto


Max index of 3D array
Given a three dimensional array M(m,n,p) write a code that finds the three coordinates x,y,z of the Maximum value. Example ...

más de 9 años hace

Resuelto


Number of odd and even elements within matrix
Input(m) - any matrix with integers Output(n) - n(1)=number of odd elements, n(2)=number of even elements Example: * m=...

más de 9 años hace

Resuelto


COUNT VOWEL
Count, how many times vowels occurred. EXAMPLE: x='string the MaTLaBiAn' then the answer will be 6. x='coUnt the vowEl' th...

más de 9 años hace

Resuelto


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

más de 9 años hace

Resuelto


Permute diagonal and antidiagonal
Permute diagonal and antidiagonal For example [1 2 3;4 5 6;7 8 9] -> [3 2 1;4 5 6;9 8 7] WITHOUT diag function (and variable n...

más de 9 años hace

Resuelto


Matrix with different incremental runs
Given a vector of positive integers a = [ 3 2 4 ]; create the matrix where the *i* th column contains the vector *1:a(i)...

más de 9 años hace

Cargar más