Solved

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

3 years ago

Solved

Reshape a Vector

Write a function that accept three inputs. The first one is a row vector S. The second and third arguments are m and n which de...

3 years ago

Solved

Remove All elements less than 5

Given an input vector x, remove all elements of x less than 5 . Example: Input x = [ 1 2 5 7 3 ] Output y is [ 5 7 ...

3 years ago

Solved

Upper Matrix Mock

Given a vector v=[1 3 6 9 11], turn it into a matrix 'ramp' like so: m=[1 3 6 9 11; 0 1 3 6 9; 0 0 1 3 6; 0 0 0 1...

3 years ago

Solved

Implement zero-based indexing for Matrices

Given an input vector and position (which is zero based) output the value Example: x = [1 2; 4 5] pos = [0 1] value = 5 ...

3 years ago

Solved

Create tangent function out of cosine only

Please don't use tangent and sine functions

3 years ago

Solved

Reverse a string

Reverse the given string. Example input = 'reverse' output = 'esrever'

3 years ago

Solved

Rotate a matrix for 180 degree

Rotate a matrix for 180 degree for eg: x=[1 2 3 4] y=[4 3 2 1]

3 years ago

Solved

Rotate a matrix for 180 degree

Rotate a matrix for 180 degree for eg: x=[1 2 3 4] y=[4 3 2 1]

3 years ago

Solved

Rotate matrix by -90 degrees

Rotate a Matrix by -90 degrees Example: X = 1 2 3 4 5 6 7 8 9 output = 7 4 ...

3 years ago

Solved

Remove the first, third and fifth rows of a matrix

Given a matrix x with at least five rows, return a matrix y that includes all rows of x except for th 1st, the 3rd and 5th. E...

3 years ago

Solved

Great Circle Distance

Find shortest between two points on a ball given their azimuthal and polar angles (in degrees) as well as the radius of the sphe...

3 years ago

Solved

Make an N-dimensional Multiplication Table

*INSTRUCTIONS* This is a multi-dimensional variant of the normal multiplication table used to teach elementary students multi...

3 years ago

Solved

Remove the air bubbles

Given a matrix a, return a matrix b in which all the zeros have "bubbled" to the top. That is, any zeros in a given column shoul...

3 years ago

Solved

Find the biggest empty box

You are given a matrix that contains only ones and zeros. Think of the ones as columns in an otherwise empty floor plan. You wan...

3 years ago

Solved

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

3 years ago

Solved

Change a specific color in an image

The ability to change colors can be a useful tool in image processing. Given an m x n x 3 array (much like CData in images), fin...

3 years ago

Solved

Enlarge array

Given an m-by-n numeric array (A) and a 1-by-2 vector (sz) indicating the dimensions [p q] to enlarge each element, return an (m...

3 years ago

Solved

Are you in or are you out?

Given vertices specified by the vectors xv and yv, and a single point specified by the numbers X and Y, return "true" if the poi...

3 years ago

Solved

Spot the First Occurrence of 5

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

3 years ago

Solved

Polygonal numbers

The task of <http://www.mathworks.co.uk/matlabcentral/cody/problems/5 Problem 5> is to calculate triangular numbers. By playing ...

3 years ago

Solved

Bell Number calculator

Calculate a vector of Bell numbers for sets up to length n. Bell numbers are the maximum number of partitions of a set. See the ...

3 years ago

Solved

Number of Even Elements in Fibonacci Sequence

Find how many even Fibonacci numbers are available in the first d numbers. Consider the following first 14 numbers 1 1 2...

3 years ago

Solved

Project Euler: Problem 2, Sum of even Fibonacci

Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 te...

3 years ago

Solved

Octoberfest festival

A group of students decided to visit Octoberfest festival. First they ordered one beer, then after half-hour they taken one more...

3 years ago

Solved

pay it forward

Choose a number (integer between 0 and 65535) You will pass this problem if you are the *second* person to choose that same n...

3 years ago

Solved

Too Many Zeros, Dump Them!

Sometimes when I create a matrix, I use this syntax: a = zeros(1000,1000); But when the function ends, I find that I don'...

3 years ago

Solved

Covering area

As an extension of the problem <http://www.mathworks.com/matlabcentral/cody/problems/416-polygon-area>, find the area, bounded b...

3 years ago

Solved

Angle between Two Vectors

The dot product relationship, a dot b = | a | | b | cos(theta), can be used to determine the acute angle between vector a and ve...

3 years ago