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 maanden 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 maanden 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 maanden 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 maanden 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 maanden 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 maanden 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 maanden 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 maanden 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 maanden 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 maanden 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 maanden 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 maanden 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 maanden 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 maanden 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 maanden 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 maanden 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 maanden 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 maanden 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 maanden 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 maanden 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 maanden 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 maanden ago

Solved

Vector Multiplication

Vector Multiplication of three matrix as shown in test cases.

12 maanden 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 maanden 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 maanden 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 maanden 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 maanden 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 maanden 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 maanden 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 maanden ago