已解决


Successive zeros (harder)
The problem is from Problem 45436, <https://www.mathworks.com/matlabcentral/cody/problems/45436-successive-zeros> Suppose n i...

15 days 前

已解决


Successive zeros
Suppose n is the number of digits a number contains. Now, 12032 - is a valid n=5 digit number. But 10023 - is defined as i...

16 days 前

已解决


Determinant of a 3x3 Matrix
Return the determinant of a 3x3 matrix. The built-in Matlab function det is not allowed.

16 days 前

已解决


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

16 days 前

已解决


Combinations without using nchoosek
You have to generate a matrix with all possible combinations of n elements *taken 2* at a time, *without using nchoosek(1:n,2)* ...

16 days 前

已解决


Remove from a 2-D matrix all the rows that contain at least one element less than or equal to 4
Example: in = magic(5) in = 17 24 1 8 15 23 5 7 14 16 4 6 13 20 ...

16 days 前

已解决


Tony's trick for duplicating an mx1 vector n times
Without using repmat, or for loop, or concatenation, create a function to duplicate a vector, v, a specified number of times, n....

16 days 前

已解决


Diagonal Prod

16 days 前

已解决


swap sign sum & multiply castles
It is an easy problem, if you know the answer. Given a square matrix of NxN ordinary numbers. Initially place N identical indi...

16 days 前

已解决


Find the Pattern 5

16 days 前

已解决


Find the Pattern 6

16 days 前

已解决


Find the Pattern 7

16 days 前

已解决


Find the Pattern 9

17 days 前

已解决


Is my wife right?
Regardless of input, output the string 'yes'.

17 days 前

已解决


Maintain shape of logical-index mask
When using logical indexing into an array, MATLAB returns a vector output. For example, if A = magic(3); mask = logi...

17 days 前

已解决


Parasitic numbers
Test whether the first input x is an n-parasitic number: <http://en.wikipedia.org/wiki/Parasitic_number>. ( _n_ is the second in...

17 days 前

已解决


Change matrix to vector
Vector is a matrix whose size is 1 x n or n x 1. Change matrix to vector. x = 4 3 5 1 ...

17 days 前

已解决


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

17 days 前

已解决


Find the Pattern 8

17 days 前

已解决


Odd elimination
Inspired by Project Euler problem #539 You'll be given a vector from 1 to n; Going from left to right, remove the first n...

17 days 前

已解决


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

17 days 前

已解决


Hoax Numbers
A Hoax Number (OEIS A019506) is defined as a composite number, whose sum of digits is equal to the sum of digits of its distinct...

17 days 前

已解决


Perfect Square
Determine if the input is a perfect square (square of an integer) or not. Example - If input is 25(==5^2), return 1. If input...

17 days 前

已解决


Sum Rows
Sum the same indexed (unique) rows. Examine the test suite. Related Challenge - <http://www.mathworks.com/matlabcentral/cody/...

17 days 前

已解决


Union of two set decreasing order
Union of two set decreasing order Say, x=[1 2 5] and y=[5 7 8] then answer must be [8 7 5 2 1]

17 days 前

已解决


Count number of words in string
Count number of words in string Examples 'hi', answer is 1 'hi hi', answer is 2 'I enjoy cody', answer is 3

17 days 前

已解决


Remove runs of at least n consecutive NaNs
This problem is inspired by Dyuman Joshi's problem 58329. Given a row vector x and a natural number n, remove all runs of at lea...

17 days 前

已解决


Generate vector according to sign of vector
Generate vector according to sign of vector Example: If A=[-2 0 5] then output must be[-1 0 1] meaning that for negative n...

17 days 前

已解决


Conditional transpose
You're given two vectors of the same length, x and y, which might be row or a column vectors. Your task is to ensure that y has ...

17 days 前

已解决


Number generator
In this problem, a number will be given. starting with the first digit, keep on adding all subsequent digits till the state (...

18 days 前

加载更多