A résolu


Return a list sorted by number of consecutive occurrences
Inspired by Problem 38 by Cody Team. Given a vector x, return a vector y of the values in x sorted by the number of CONSECUTIVE ...

environ 2 mois il y a

A résolu


Construct an index vector from two input vectors in vectorized fashion
Create an index vector defined by two input vectors, one defining the beginnings of one or more index ranges, and the other defi...

environ 2 mois il y a

A résolu


03 - Matrix Variables 3
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_3c.png>> A 10x10 matrix where the numbers from 1 to 100 ...

environ 2 mois il y a

A résolu


Parallel vectors
Return true or false depending on whether 2 vectors are parallel or not. Vectors can be 2 or 3 dimensional. The origin is not c...

environ 2 mois il y a

A résolu


Cancel Middle
Write a function called cancel_middle that takes A, an n-by-m matrix, as an input where both n and m are odd numbers an...

environ 2 mois il y a

A résolu


ASCII Birthday Cake
Given an age and a name, give draw an ASCII birthday cake. For example, given the name "CODY" and the age 5, return a string wit...

environ 2 mois il y a

A résolu


5 Prime Numbers
Your function will be given lower and upper integer bounds. Your task is to return a vector containing the first five prime numb...

environ 2 mois il y a

A résolu


Ripping numbers apart!
So you have to "rip" a number apart into individual digits... The end output is a cell. That is if: x = 12345678 o...

environ 2 mois il y a

A résolu


String substitution, sub problem to cryptoMath
This is a sub problem related to this problem: <http://www.mathworks.com/matlabcentral/cody/problems/621-cryptomath-addition>...

environ 2 mois il y a

A résolu


Add more zeros
Find code that adds one 0 to each sequence of 0 in a string (composed with only 0 or 1). For example: '1010' -> '100100' ...

environ 2 mois il y a

A résolu


Combinations without using nchoosek
You have to generate a matrix with all possible combinations of n elements *taken 2* at a time, *without using nchoosek(1:n,2)* ...

environ 2 mois il y a

A résolu


Make a logical diamond using GALLERY function
Inspired from <http://www.mathworks.com/matlabcentral/cody/problems/1078-make-a-diamond Problem 1078. Make a diamond> In thi...

environ 2 mois il y a

A résolu


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

environ 2 mois il y a

A résolu


Find vampire numbers
A vampire number is a number v that is the product of two numbers x and y such that the following conditions are satisfied: at ...

environ 2 mois il y a

A résolu


How unique?
Sometimes, when we check unique entries of vector we would like to know how many times each value occurs. Given vector of num...

environ 2 mois il y a

A résolu


Would Homer Like It?
Given a matrix of ones and zeros, you must determine if there are any doughnuts present (would Homer Simpson like it?). A doug...

environ 2 mois il y a

A résolu


Prime Ladders
A <http://en.wikipedia.org/wiki/Word_ladder word ladder> transforms one word to another by means of single-letter mutations. So ...

environ 2 mois il y a

A résolu


Is It a Snake?
Given an m-by-n matrix, return true if the elements of the matrix are a connected "snake" shape from 1 to m*n. Otherwise return ...

environ 2 mois il y a

A résolu


Solve for factorial of X
It gives you the number x, and set y equal to x factorial. Ex. There are 52 cards in a deck, each specific order of all 52 car...

environ 2 mois il y a

A résolu


Find a subset that divides the vector into equal halves
Given a vector x, return the indices to elements that will sum to exactly half of the sum of all elements. Example: Inpu...

environ 2 mois il y a

A résolu


How many trades represent all the profit?
Given a list of results from trades made: [1 3 -4 2 -1 2 3] We can add them up to see this series of trades made a profit ...

environ 2 mois il y a

A résolu


Spot the outlier
All points except for one lie on a line. Which one is the outlier? Example: You are given a list of x-y pairs in a column ...

environ 2 mois il y a

A résolu


Solitaire Cipher
Implement the <http://en.wikipedia.org/wiki/Solitaire_(cipher) solitaire cipher>. Since this is from Wikipedia, I am capturin...

environ 2 mois il y a

A résolu


How long is the longest prime diagonal?
Stanislaw Ulam once observed that if the counting numbers are arranged in a spiral, the prime numbers contained in it form a sur...

environ 2 mois il y a

A résolu


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

environ 2 mois il y a

A résolu


Double Fibonacci
double_fibonacci takes two integers, each greater than one, as input arguments (it does not have to check the format of the inpu...

environ 2 mois il y a

A résolu


Reverse the input
Given an input (n), produce an output in the reverse order with out using string variables or string function. Example x ...

environ 2 mois il y a

A résolu


Sort in descending order.

environ 2 mois il y a

A résolu


Summation of integers

environ 2 mois il y a

A résolu


Largest Twin Primes
<http://en.wikipedia.org/wiki/Twin_prime Twin primes> are primes p1, p2 = p1 + 2 such that both p1 and p2 are prime numbers. Giv...

environ 2 mois il y a

Charger plus