Solved


Get a Fibonacci number's index.
*N.B.* For the purpose of this exercise, the first Fibonacci number is 1, and the second is 2; that is, |fib(1) = 1| and |fib(2)...

2 months ago

Solved


Matlab Basics II - Operations and Matrix Dimensions
Write a function that takes two inputs, a & b, and outputs the sum and product of the two matrices. The matrices have OPPOSITE d...

2 months ago

Solved


feeling VERY lucky?
Just like Matthew's problem 2793 and Edward's problem 2872 (guess the number that Cody is thinking) but now you must solve it in...

2 months ago

Solved


İmage Series 1 OR
Given two input first one is a number which is uint8, second one is image which is 8 bit gray scale image, the image has pixsels...

2 months ago

Solved


Is the test point on the line segment?
Given the [x,y,z] coordinates for the three points pa, pb, and pc, return true if the test point pc is on the line segment with ...

2 months ago

Solved


Modify subscripts
MATLAB supports object-oriented programming. Let's take an advantage of it in cody. This problem starts <http://uk.mathworks....

2 months ago

Solved


Modify subscripts - easier
MATLAB supports object-oriented programming. Let's take an advantage of it in cody. This problem focus on modifying subscript...

2 months ago

Solved


Regex match
Many regular expression engines have a simple function to quickly know whether a regular expression entirely matches a string or...

2 months ago

Solved


Split up vector or matrix delimited by NaNs
Given several vectors contained within one vector delimited by NaNs, return each individual vector as an element of a cell vecto...

2 months ago

Solved


Find Sign(Zero Crossing) Changes in Array
Example; A = [1 2 3 -3 -4 -1 -24 2 4 -1 -2 3 1]; ans; [1 2 0 -3 -4 -1 0 2 0 -1 ...

2 months ago

Solved


Check if vertices form a rectangle
Given a set of 4 vertices defined by vectors X and Y, return true if the vertices form a rectangle and false otherwise. X and Y...

2 months ago

Solved


Multiply Column
Given two input, one matrix and one scalar number For example A is a matrix given A = [ 1 2 2 5 2 5 2 3 4 6...

2 months ago

Solved


Find out Binomial coefficient
Find out the <http://en.wikipedia.org/wiki/Binomial_coefficient Binomial coefficient>. There is a function available in MATL...

2 months ago

Solved


Probability of winning single-elimination tournament
Find the probability that the p^{th} player will win a single-elimination tournament with 2^n players where M(i,j)=probability t...

2 months ago

Solved


Error handling
If the input is a negative number, generate an error. Otherwise, return the number.

2 months ago

Solved


Convert a grayscale image into RGB colour format, preserving data type
In the Image Processing Toolbox, MATLAB provides rgb2gray to convert a 3 channel color image into a 1 channel intensity...

2 months ago

Solved


Find out base of following arithmetic operation
Find out base of the following arithmetic operation. So for example 41/3=13 is true in base 8. Another example: 23+44+14...

2 months ago

Solved


Clear all empty variables from the workspace
I want to clear all empty variables from my workspace. See tests suite.

2 months ago

Solved


What is the scope of variables in Matlab ?
How to do this little hack ? a=10; b=5; y=change_var(a,1); assert(isequal(a,1))

2 months ago

Solved


Find my secret number
I try to hide a secret number in the workspace amongst others variables. I am paranoid so I change his value and his name a...

2 months ago

Solved


Assign matrix rows/columns to separate variables
This is a slight variant of <http://www.mathworks.com/matlabcentral/cody/problems/2668-assign-matrix-elements-to-separate-variab...

2 months ago

Solved


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

2 months ago

Solved


Ulam spiral 2: The revenge
Starting from the problem <https://www.mathworks.com/matlabcentral/cody/problems/2644-the-ulam-matrix>, transform the Ulam Matri...

2 months ago

Solved


Find the maximal cliques in an undirected graph
This is a variant of a <http://www.mathworks.com/matlabcentral/cody/problems/2646-determine-the-number-of-maximal-cliques-in-an-...

2 months ago

Solved


Determine the number of maximal cliques in an undirected graph
In an undirected graph, a clique is a subset of vertices that are fully connected, i.e. there is an edge between all pairs of ve...

2 months ago

Solved


Dispatch and collect
Write a function that dispatches the single argument _x_ to multiple function handles (varargin) and concatenates vertically the...

2 months ago

Solved


Higher! Lower!
My kids have started to play the "I'm thinking of a number between X and Y" game in the car on trips to and from their swim less...

2 months ago

Solved


Number of Flip Flop required in ripple counter
Find the number of flip flop required in ripple counter. If modulus of counter (N) is given find outnumber of Flip Flop (n) r...

2 months ago

Solved


counting for loop
Complete the function below using a for loop to count from 3 to N by 2. For example, if N is 10, count 3, 5, 7, 9 and stop. Fo...

2 months ago

Solved


Alternative Scoring. Create an incremental spiral.
This problem is created to test an alternative Cody scoring system. It is based on the current one, but few changes are introduc...

2 months ago

Load more