Resuelto


How many complete pizzas (number 2)
x is a vector with numbers of pizza slices. A corresponding vector n indicates in how many slices the pizza slices of x were cut...

3 meses hace

Resuelto


Dial Up
Each number on telephone keypads, except 0 and 1, corresponds to a set of uppercase letters as shown in this list: 2 ABC, 3 DEF...

3 meses hace

Resuelto


Roman numbers: how old is that building?
The front of old buildings sometimes show the year when they were built in roman numbers. These number are rather confusing and ...

3 meses hace

Resuelto


Create an empty array
Suppose you need an empty array. e = [] will give you one, but it's a double array, which may not help if you need a differen...

3 meses hace

Resuelto


Count up then down
Create a function that produces counting up from 0 up to n then down to 0 n=2 --> 0 1 2 1 0 n=3 --> ...

3 meses hace

Resuelto


Find all repeated numbers
For a given vector, find all numbers that repeated 2 times or more than 2 times. Example: A=[1 2 3 3 4 5 6 6 7] y=[3 ...

3 meses hace

Resuelto


How to calculate the length of a triangle's side given two angles and one side
You are given a triangle with angles alpha, beta and gamma and sides a opposite alpha, b opposite beta and c opposite gamma. ...

3 meses hace

Resuelto


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

3 meses hace

Resuelto


Leonardo primes
Leonardo numbers are defined by following recurrence relation: Leonard prime is Leonardo number which is also prime (see ...

3 meses hace

Resuelto


Power of n ?
Determine if x (positive integer) is a power of n, return true or false accordingly.

3 meses hace

Resuelto


Prime number check (★★)
One way to see if a number x is prime is to compute the remainders obtained when dividing x by all integers from 2 to √(x). If x...

3 meses hace

Resuelto


pizza deals
Given two pizza slices of different sizes: * Slice A with angle alpha1, radius r1, and price p1 * Slice B with angle alpha2,...

3 meses hace

Resuelto


Sum Rows
Sum the same indexed (unique) rows. Examine the test suite. Related Challenge - <http://www.mathworks.com/matlabcentral/cody/...

3 meses hace

Resuelto


Cannibal eating odd and even numbered men
There are N men in a queue. A cannibal eats either all odd-numbered or all even-numbered men in the queue at a time. In the fi...

3 meses hace

Resuelto


Divide polynomial p1 by p2.
Divide polynomial p1 by p2 given as vectors. Return result q and r vectors which corresponds the quotient and remainder of divis...

3 meses hace

Resuelto


Half?
If you toss an even number (x) of coins, what is the probability (y) of 50% head and 50% tail?

3 meses hace

Resuelto


06 - Matrix Equations 3
Define the matrices _aMat_, _bMat_, and _cMat_: <<http://samle.dk/STTBDP/Assignment1_3a.png>> ( _aMat_ = 9x9 matrix full o...

3 meses hace

Resuelto


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

3 meses hace

Resuelto


Find prime number couples
Given a vector a, which will always contain at least one pair of prime numbers couple, return a matrix called 'couple' in which ...

3 meses hace

Resuelto


What time can I drive after drinking?
At T o'clock, after a hard day of Matlab, I immediately start drinking and treat myself to N pints of tasty beer. Each beer I dr...

3 meses hace

Resuelto


convert 2D array of ones and zeros to checkerboard array of [1,2] where the original array was ones and zero elsewhere
Given a 2D array of ones and zeros, generate an equivalent sized checkerboard array of ones and twos. The checkerboard pattern s...

3 meses hace

Resuelto


Sum! Sum! Sum!
Calculate the sum of the sequence up to nth term >> a,aa,aaa,aaaa,... 2,22,222,2222,... [for a=2]

3 meses hace

Resuelto


Determinant of a 3x3 Matrix
Return the determinant of a 3x3 matrix. The built-in Matlab function det is not allowed.

3 meses hace

Resuelto


Unique dice configurations
Given a number of dice N and the number of sides on each die S, write a MATLAB function that will output how many unique permuta...

3 meses hace

Resuelto


Generate a string like abbcccddddeeeee
This is the string version of Problem 1035. <http://www.mathworks.com/matlabcentral/cody/problems/1035-generate-a-vector-like-1-...

3 meses hace

Resuelto


Check transmitted data follow even parity (True or false)
Check transmitted data follow even parity (True or false) <http://en.wikipedia.org/wiki/Parity_bit/ Parity Bit> Say, '010...

3 meses hace

Resuelto


Find two numbers that add up to the target value
Given a vector A and target n, return the indices of two numbers that add up to n. If there are multiple solutions, return the f...

3 meses hace

Resuelto


Draw 'W'
For any given n, return a matrix of height n and width 4n-3 containing a W of ones. Example: n=2 ans= [1 0 1 0 1 0 1 0 1 0...

3 meses hace

Resuelto


Circular Segment Area
Let us consider a circle with radius . If we draw an angle (in radians) from the center of the circle, the two radii forming th...

3 meses hace

Cargar más