Gelöst


Dealfun (1.0)
*Short description.* Write a function _dealfun_: [y1,y2,...,yn]=dealfun(fhandle,x1,x2,...,xn) which evaluates the f...

etwa ein Monat vor

Gelöst


Negation and new variables
Inspired by Problem 1827 by Andrew Newell. Write a function that has the following property: (x~=y) neg3(x)=x; neg3...

etwa ein Monat vor

Gelöst


Assign matrix elements to separate variables
Given an input array, return each element of the array as a separate variable. If the number of output arguments (k) is less tha...

etwa ein Monat vor

Gelöst


Play Hocus Focus
The card game Hocus Focus starts by placing twelve cards with wizards face up on a table. The characteristics of the wizards tha...

etwa ein Monat vor

Gelöst


Probabilities - Balls and urns - 01
The urn contains B blue balls and R red balls. Each trial consists of drawing one random ball from the urn and observing its col...

etwa ein Monat vor

Gelöst


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

etwa ein Monat vor

Gelöst


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

etwa ein Monat vor

Gelöst


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

etwa ein Monat vor

Gelöst


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

etwa ein Monat vor

Gelöst


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

etwa ein Monat vor

Gelöst


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

etwa ein Monat vor

Gelöst


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

etwa ein Monat vor

Gelöst


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

etwa ein Monat vor

Gelöst


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

etwa ein Monat vor

Gelöst


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

etwa ein Monat vor

Gelöst


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

etwa ein Monat vor

Gelöst


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

etwa ein Monat vor

Gelöst


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

etwa ein Monat vor

Gelöst


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

etwa ein Monat vor

Gelöst


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

etwa ein Monat vor

Gelöst


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

etwa ein Monat vor

Gelöst


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

etwa ein Monat vor

Gelöst


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

etwa ein Monat vor

Gelöst


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

etwa ein Monat vor

Gelöst


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

etwa ein Monat vor

Gelöst


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

etwa ein Monat vor

Gelöst


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

etwa ein Monat vor

Gelöst


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

etwa ein Monat vor

Gelöst


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

etwa ein Monat vor

Mehr laden