문제를 풀었습니다


Identify the heavier bag
There are N=2^n bags of rice looking alike, N-1 of which have equal weight and one is slightly heavier. The weighing balance is ...

5년 초과 전

문제를 풀었습니다


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

5년 초과 전

문제를 풀었습니다


Given n, create n random numbers such that their standard deviation is also n.
Given n, create n random numbers such that their standard deviation is also n.

5년 초과 전

문제를 풀었습니다


Vector LCM
* Find Least Common Multiple of a given vector. * Need general solution as the test suite will be expanded. * Function Templa...

5년 초과 전

문제를 풀었습니다


Back to basics 4 - Search Path
Covering some basic topics I haven't seen elsewhere on Cody. Return a string that is the user's portion of the current search...

5년 초과 전

문제를 풀었습니다


vector to string
Determine what the ASCII characters spell out. Example: input = [ 72 73 71 72] output = 'HIGH'

5년 초과 전

문제를 풀었습니다


Find out magnitude of vector
Find out magnitude of vector. Say x=[1 2 3], then answer must sqrt(1^2+2^2+3^2) Please don't use sum function. If you l...

5년 초과 전

문제를 풀었습니다


Determine the Anti-diagonal of a Magic Square
Determine the anti-diagonal (crossing from top right to lower left) of a magic square of size n. Examples If n = 3 y =...

5년 초과 전

문제를 풀었습니다


Create Vector containing following elements
Create Vector containing following elements A=[pi eps NaN inf -inf flintmax];

5년 초과 전

문제를 풀었습니다


Vector Multiplication
Vector Multiplication of three matrix as shown in test cases.

5년 초과 전

문제를 풀었습니다


Add two hex numbers
Add two hex numbers

5년 초과 전

문제를 풀었습니다


Is it column vector?
Is it column vector? Check vector for column vector without using iscolumn function.

5년 초과 전

문제를 풀었습니다


Eye Squared
For a positive integer |n| create the identity matrix with |n| elements. In case it is not possible to produce an identity ma...

5년 초과 전

문제를 풀었습니다


Separate even from odd numbers in a vector - without loops
*Without using loops*, rearrange a vector of integers such that the odd numbers appear at the beginning, and even numbers at the...

5년 초과 전

문제를 풀었습니다


How many unique Pythagorean triples?
For a given integer |n|, return all <https://en.wikipedia.org/wiki/Pythagorean_triple Pythagorean triples> that inlude numbers s...

5년 초과 전

문제를 풀었습니다


Find the sides of an isosceles triangle when given its area and height from its base to apex
Find the sides of an isosceles triangle when given its area and the height from its base to apex. For example, with A=12 and ...

5년 초과 전

문제를 풀었습니다


Draw 'J'
Given n as input, generate a n-by-n matrix 'J' using 0 and 1 . Example: n=5 ans= [0 0 0 0 1 0 0 0 0 1 0 0 ...

5년 초과 전

문제를 풀었습니다


Binary code (array)
Write a function which calculates the binary code of a number 'n' and gives the result as an array(vector). Example: Inpu...

5년 초과 전

문제를 풀었습니다


Natural numbers in string form
Create a cell array of strings containing the first n natural numbers. _Slightly_ harder than it seems like it should be. Ex...

5년 초과 전

문제를 풀었습니다


Add more zeros
Find code that adds one 0 to each sequence of 0 in a string (composed with only 0 or 1). For example: '1010' -> '100100' ...

5년 초과 전

문제를 풀었습니다


Divide elements by sum of elements
In this problem, I ask you to write a function which will divide the elements of each column by the sum of the elements of the s...

5년 초과 전

문제를 풀었습니다


Matrix of Multiplication Facts
This is James's daughter again, sneaking into his Cody account. Thanks to your help in my math class last year, I did great! B...

5년 초과 전

문제를 풀었습니다


Split a string into chunks of specified length
Given a string and a vector of integers, break the string into chunks whose lengths are given by the elements of the vector. Ex...

5년 초과 전

문제를 풀었습니다


How many digits are there?
Input(s) - any string Output(n) - number of digits within string s

5년 초과 전

문제를 풀었습니다


Convert a vector into numbers
Suppose a vector x = [ 1 2 4 7] is given. You have to convert this vector into string number y = '1247'. Examples x = [ 1...

5년 초과 전

문제를 풀었습니다


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

5년 초과 전

문제를 풀었습니다


Find Out sum of principal diagonal element of given matrix
Find out sum of principal diagonal element of given matrix If A=[1 0 0; 0 1 0;0 0 1], then answer must be 3.

5년 초과 전

문제를 풀었습니다


Horizontal matrix sort
Given a matrix x with n rows and m columns, return a matrix y with n rows and 2m columns, such that every row in x is sorted fro...

5년 초과 전

문제를 풀었습니다


Integer sequence - 2 : Kolakoski sequence
Get the n-th term of <https://oeis.org/A000002 Kolakoski Sequence>.

5년 초과 전

문제를 풀었습니다


Square Digits Number Chain Terminal Value (Inspired by Project Euler Problem 92)
Given a number _n_, return the terminal value of the number chain formed by summing the square of the digits. According to the P...

5년 초과 전

더 보기