Solved


Append two matrix as shown below example
Append two matrix as shown below example A=[1 2; 3 4] and B=[5 6;7 8] Answer must be 1 2 5 6 3...

8 years ago

Solved


Product of elements in row
Product of matrix such that a=[3 3 1] b=9

8 years ago

Solved


Mode
Find the mode of the vector Assumption: no vector is bimodal Example 1: input=[1 2 3 4 4]; output=4 Example 2: input=[7...

8 years ago

Solved


kmph to mps
convert kilometer per hour to meter per second

8 years ago

Solved


Fizz Buzz
Given an array of positive, non-zero, integers, return a cell array of strings the same size as the input, where each element in...

8 years ago

Solved


The Dark Side of the Die
It is well-known that opposite sides of a classic hexahedral die add to 7. Given a vector of dice rolls, calculate the sum of th...

8 years ago

Solved


Check if equal
Return true if all the elements of an nD array are equal, false otherwise.

8 years ago

Solved


More luck than brains
Give a random function that guess and return numbers from 1 to 6 exactly like the test suite .

8 years ago

Solved


Probability of red tulips
I hope to give you bulbs of tulip. But I do not know the color of those petals. I just know that the color is red, white or yell...

8 years ago

Solved


Get the elements of diagonal and antidiagonal for any m-by-n matrix
In the problem <http://www.mathworks.com/matlabcentral/cody/problems/858-permute-diagonal-and-antidiagonal Problem 858. Permute ...

8 years ago

Solved


Piecewise linear interpolation
Given an Mx2 vector and a row of M-1 integers, output a two column vector that linearly interpolates Y times between each succes...

8 years ago

Solved


Create logical matrix with a specific row and column sums
Given two numbers *|n|* and *|s|*, build an |n-by-n| logical matrix (of only zeros and ones), such that both the row sums and th...

8 years ago

Solved


Insert zeros into vector
Insert zeros after each elements in the vector. Number of zeros is specified as the input parameter. For example: x = [1 ...

8 years ago

Solved


Find nth maximum
Find nth maximum in a vector of integer numbers. Return NaN if no such number exists. x = [2 6 4 9 -10 3 1 5 -10]; So ...

8 years ago

Solved


Finding peaks
Find the peak values in the signal. The peak value is defined as the local maxima. For example, x= [1 12 3 2 7 0 3 1 19 7]; ...

8 years ago

Solved


Max index of 3D array
Given a three dimensional array M(m,n,p) write a code that finds the three coordinates x,y,z of the Maximum value. Example ...

8 years ago

Solved


Unique values without using UNIQUE function
You must return unique values in a vector in *stable* mode without using the unique function. About stable order flag: ...

8 years ago

Solved


Calculate the Number of Sign Changes in a Row Vector (No Element Is Zero)
For a row vector: V=[7 1 2 -3] there is one sign change (from 2 to -3). So, the function you write must return N=1. F...

8 years ago

Solved


Oh Zero Zero Zero!!!
Hello all, So you have to find the largest section of zeros in a vector and then find the length of those zeros and there start...

8 years ago

Solved


Reference Index Number
Given a reference set R of elements (each unique but identical in type), and a list V of elements drawn from the set R, possibly...

8 years ago

Solved


Mastermind V: Optimal Solver - average number of guesses
The following description contains a copy of Richard Zapor's <https://www.mathworks.com/matlabcentral/cody/problems/44239-master...

8 years ago

Solved


Add two numbers
Calculate the sum of two numbers. Example input = [2 3] output = 5

8 years ago

Solved


Mastermind IV: Optimal Solver - max of 5 guesses
<https://en.wikipedia.org/wiki/Mastermind_(board_game) Mastermind> is a code breaking logic puzzle. A pattern of 6 colors(values...

8 years ago

Solved


Fibonacci-Sum of Squares
Given the Fibonacci sequence defined by the following recursive relation, * F_n = F_(n-1) + F_(n-2) * where F_0 = 0 and F_1 ...

8 years ago

Solved


Find the stride of the longest skip sequence
We define a _skip sequence_ as a regularly-spaced list of integers such as might be generated by MATLAB's <http://www.mathworks....

8 years ago

Solved


Project Euler: Problem 10, Sum of Primes
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below the input, N. Thank you <http:/...

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

8 years ago

Solved


First non-zero element in each column
For a given matrix, calculate the index of the first non-zero element in each column. Assuming a column with all elements zero ...

8 years ago

Solved


Replace all zeros and NaNs in a matrix with the string 'error'
Given a numeric input matrix A, possibly containing some zero values and some NaNs, replace any occurrences of zero or NaN with ...

8 years ago

Solved


"Look and say" sequence
What's the next number in this sequence? * [0] * [1 0] * [1 1 1 0] * [3 1 1 0] * [1 3 2 1 1 0] This a variant on the w...

8 years ago

Load more