Solved

Genome decoding

Inspired by a question on the answer forum: You are given a matrix of 8-bit integers which encodes a genome. Each integer can...

12 months ago

Solved

From a given cell array of strings, extract the non-unique strings.

We are given a cell array of strings C. From this cell array we require to extract the subset of non-unique strings, returning t...

12 months ago

Solved

Adding Cells with numbers defined as strings

Given a cell, with strings representing numbers, add each value. For example: a = {'9','33'}; the output should be: ...

12 months ago

Solved

Find the longest match inside two strings

Given two strings, find the longest string which is contained within both strings. e.g. the longest string that is contained ...

12 months ago

Solved

Broken numlock key, oppps !

The numlock key on my computer is pressed and is now broken, so I cant press it to switch off the numlock mode. And hence I am n...

12 months ago

Solved

Perimeter

Given a sequence of points forming a closed path (first and last points are coincident) return the perimeter value. For example...

12 months ago

Solved

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

12 months ago

Solved

Back to basics 2 - Function Path

Covering some basic topics I haven't seen elsewhere on Cody. Given a string that is the name of a MATLAB function, return a s...

12 months ago

Solved

Sum the elements in either diagonal of a square matrix

Sum the elements of a square matrix that lie on either the major diagonal or anti-diagonal. (Include all elements that are part ...

12 months ago

Solved

Matlab Basics - Pick out parts of a vector

Consider x a vector of length >= 7 (there are at least 7 elements in the vector, write a script that extracts the 2nd element, a...

12 months ago

Solved

Find the average of a random sequance

Write a function that generates random integers within a loop, and calculates the mean of the positive numbers only. At each ...

12 months ago

Solved

Breaking Out of the Matrix

Do you want to take the Red Pill, or the Blue Pill? If you take the Blue Pill, you will simply pass along to the next problem...

12 months ago

Solved

The Top 5 Primes

This problem series invites you to solve two simple problems related to the integer NUMBER FIVE, in order to celebrate <https://...

12 months ago

Solved

Back to basics 13 - Input variables

Covering some basic topics I haven't seen elsewhere on Cody. Return as a string the name of the input variable to the functio...

12 months ago

Solved

Sum of Two Numbers

Given two integer numbers x and y, calculate their sum and put it in z. Examples: Inputs x = 2, y = 4 Output z is 6 ...

12 months ago

Solved

Back to basics 17 - white space

Covering some basic topics I haven't seen elsewhere on Cody. Remove the trailing white spaces from the input variable

12 months ago

Solved

The glass half full

Identical glasses are placed in a triangular tower structure, such that the top level (L = 1) comprises one glass, the next leve...

12 months ago

Solved

Composing relative poses in 2D: problem 2

We consider a world reference frame denoted by {0} which has its x-axis pointing east and its y-axis pointing north. There i...

12 months ago

Solved

Composing relative poses in 2D: problem 1

We consider a world reference frame denoted by {0} which has its x-axis pointing east and its y-axis pointing north. There i...

12 months ago

Solved

Relative points in 2D: problem 3

The 2D pose of a robot, with respect to a world coordinate frame {O}, is described by a 3x3 homogenous transform matrix T. A la...

12 months ago

Solved

Relative points in 2D: problem 2

The 2D pose of a robot, with respect to a world coordinate frame {O}, is described by a 3x3 homogenous transform matrix T. A la...

12 months ago

Solved

Sums of Multiple Pairs of Triangular Numbers

This is a follow-up to <https://www.mathworks.com/matlabcentral/cody/problems/44289 Problem 44289> - Find two triangular numbers...

12 months ago

Solved

Vector Multiplication

Vector Multiplication of three matrix as shown in test cases.

12 months ago

Solved

MATLAB Counter

Write a function f = counter(x0,b) to construct a counter handle f that counts with an initial value x0 and a step size b. E...

12 months ago

Solved

Remove the air bubbles from a vector

_*A reduced version of Problem 112*_ Given a column vector v, return a vector w in which all the zeros have "bubbled" to the ...

12 months ago

Solved

Tax Calculator

Calculate the tax for a given income. 10% tax is paid for any income up to $2,000. 20% tax is paid for additional income u...

12 months ago

Solved

Vertical matrix sort

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

12 months ago

Solved

Add a vector to a matrix

Given a matrix |mat| of size |mXn| and a row vector |v| of size |1Xs|, return a matrix with |m+1| rows that conatains |mat| over...

12 months ago

Solved

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

12 months ago

Solved

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

12 months ago