문제를 풀었습니다


Calculate the sum of first x natural numbers
Calculate the sum of first x natural numbers for example if n=10 output =1+2+..+10=55

13일 전

문제를 풀었습니다


Aquiles y la tortuga
Contaba Zenón en su famosa paradoja que un día Aquiles, el guerrero griego más veloz de la Hélade, se enfrentó a una pequeña tor...

13일 전

문제를 풀었습니다


Draw 'Y'
Draw 'Y' in an x-by-x matrix (where x is odd and x >= 3) Examples: x = 3 y = [1 0 1 0 1 0 0 1 0] x = 5 y = [1...

13일 전

문제를 풀었습니다


Back to basics 7 - Equal NaNs
Covering some basic topics I haven't seen elsewhere on Cody. Given 2 input variables, output true if they are equal, false ot...

13일 전

문제를 풀었습니다


Infernal Recursion
Consider the recursion relation: x_n = (x_(n-1)*x_(n-2))^k Given x_1, x_2, and k, x_n can be found by this definition. Wr...

13일 전

문제를 풀었습니다


count any radix?
given radix r(2-9), digts d(1-4), give all possible strings in sorted order. for example, if r=2, d=2, then output {'00' '01' '1...

13일 전

문제를 풀었습니다


Check if is a square
Given four coordinates, write a function to check if they form a square on the XY plane.

13일 전

문제를 풀었습니다


Combined Ages 1 - Symmetric, n = 3
You have probably seen the common riddle wherein combined ages are provided and you must determine the individual ages. For exam...

13일 전

문제를 풀었습니다


COUNT VOWEL 2
The objective of this problem is to determine the number of unique vowels used in the given string. Now count vowels in STRI...

13일 전

문제를 풀었습니다


Red Cross ❌

13일 전

문제를 풀었습니다


Cull vector elements that contain a specified digit
Given inputs of (1) a row vector and (2) a digit, identify the elements of that vector that contain the digit, remove them, and ...

13일 전

문제를 풀었습니다


Accessing elements on the diagonal
Access the diagonal elements of a matrix without 'diag' function

13일 전

문제를 풀었습니다


One-hot encoding

13일 전

문제를 풀었습니다


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

13일 전

문제를 풀었습니다


Set defaults
Write a function that computes the volume of a cube. The function should be able to accept three inputs: the length, width, and...

13일 전

문제를 풀었습니다


check whether a number is a pentatope number
<https://oeis.org/A000332>

13일 전

문제를 풀었습니다


Compute the Dedekind psi function
Write a function to compute the Dedekind psi function. The values for n = 1, 2, 3, 4, 5, and 6 are 1, 3, 4, 6, 6, and 12.

13일 전

문제를 풀었습니다


prime to each other
Given two integers n1, n2 greater than 1, find out if they have common divisors or are prime to each other. Return "true" if the...

13일 전

문제를 풀었습니다


Juggler sequence revisited
This problem is related to <http://www.mathworks.com/matlabcentral/cody/problems/42835-return-the-sequence-element-ii Problem 42...

13일 전

문제를 풀었습니다


attenuation
A beam of X-rays propagates a length d(1) through a medium with an attenuation coefficient alpha(1). After that the beam propaga...

13일 전

문제를 풀었습니다


Integer to boolean
Write a general function that will create the following conversation; Input is a column vector with integers Output is a b...

13일 전

문제를 풀었습니다


Five Fingers
A little girl has just learnt how to count from 1 to N using the five fingers of her left hand as follows. She starts by calling...

13일 전

문제를 풀었습니다


"Identify and Replace Outliers in a Numeric Array"
Given a numeric array, identify outliers that are more than two standard deviations away from the mean and replace them with the...

13일 전

문제를 풀었습니다


Simple date to serial no. conversion
Convert a date string to a serial date number. For example if you take x='19-May-2001' then the result is 730990 x...

13일 전

문제를 풀었습니다


Detect a number and replace with two NaN's
Write code which replaces the number 1 with two NaNs. Example X = [ 1 2 NaN 4 1 3 7 NaN 1 4 NaN 2] ...

13일 전

문제를 풀었습니다


Dealfun (1.0)
*Short description.* Write a function _dealfun_: [y1,y2,...,yn]=dealfun(fhandle,x1,x2,...,xn) which evaluates the f...

13일 전

문제를 풀었습니다


Negation and new variables
Inspired by Problem 1827 by Andrew Newell. Write a function that has the following property: (x~=y) neg3(x)=x; neg3...

13일 전

문제를 풀었습니다


Assign matrix elements to separate variables
Given an input array, return each element of the array as a separate variable. If the number of output arguments (k) is less tha...

13일 전

문제를 풀었습니다


Play Hocus Focus
The card game Hocus Focus starts by placing twelve cards with wizards face up on a table. The characteristics of the wizards tha...

13일 전

문제를 풀었습니다


Probabilities - Balls and urns - 01
The urn contains B blue balls and R red balls. Each trial consists of drawing one random ball from the urn and observing its col...

13일 전

더 보기