Gelöst


Make a checkerboard matrix
Given an integer n, make an n-by-n matrix made up of alternating ones and zeros as shown below. The a(1,1) should be 1. Example...

fast 2 Jahre vor

Gelöst


High school cafeteria
Given an input vector of positive integers, return a row vector with the primes first (in increasing order) and the composites n...

fast 2 Jahre vor

Gelöst


Is my wife right?
Regardless of input, output the string 'yes'.

fast 2 Jahre vor

Gelöst


The Hitchhiker's Guide to MATLAB
Output logical "true" if the input is the answer to life, the universe and everything. Otherwise, output logical "false".

fast 2 Jahre vor

Gelöst


All your base are belong to us
Find the base _b_ logarithm of the input decimal number _x_. Express the output as a decimal number. The first argument is the n...

fast 2 Jahre vor

Gelöst


Cannon Ball
Given g (acceleration due to gravity) and desired altitude x, find the minimum ground velocity of a cannon ball to reach x.

fast 2 Jahre vor

Gelöst


give nth decimal place of pi
max 15th place after the decimal point is ok for now

fast 2 Jahre vor

Gelöst


Least common multiple of many numbers
1:6 -> 60

fast 2 Jahre vor

Gelöst


Sorted highest to lowest?
Return 1 if the input is sorted from highest to lowest, 0 if not. Example: 1:7 -> 0 [7 5 2] -> 1

fast 2 Jahre vor

Gelöst


Check if sorted
Check if sorted. Example: Input x = [1 2 0] Output y is 0

fast 2 Jahre vor

Gelöst


How to find the position of an element in a vector without using the find function
Write a function posX=findPosition(x,y) where x is a vector and y is the number that you are searching for. Examples: fin...

fast 2 Jahre vor

Gelöst


Add two numbers
Given a and b, return the sum a+b in c.

fast 2 Jahre vor

Gelöst


Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

fast 2 Jahre vor

Gelöst


Return the largest number that is adjacent to a zero
This example comes from Steve Eddins' blog: <http://blogs.mathworks.com/steve/2009/05/27/learning-lessons-from-a-one-liner/ Lear...

fast 2 Jahre vor

Gelöst


Leap years on other planets
A year is a leap year if it is divisible by 4, but not if it is divisible by 100, unless it is also divisible by 400. This mean...

fast 2 Jahre vor

Gelöst


Hexagonal numbers on a spiral matrix
Put hexagonal numbers in a ( m x m ) spiral matrix and return the sum of its diagonal elements. Formula of hexagonal numbers ...

fast 2 Jahre vor

Gelöst


Determine if input is a Narcissistic number
<http://en.wikipedia.org/wiki/Narcissistic_number Narcissistic number> is a number that is the sum of its own digits each raised...

fast 2 Jahre vor

Gelöst


generate nth pentatope number
https://en.wikipedia.org/wiki/Pentatope_number

fast 2 Jahre vor

Gelöst


Sum of series IX
What is the sum of the following sequence: Σ 1/k! for k=1...n for different n?

fast 2 Jahre vor

Gelöst


Sum of series VIII

fast 2 Jahre vor

Gelöst


Sum of series VII
What is the sum of the following sequence: Σ(km^k)/(k+m)! for k=1...n for different n and m?

fast 2 Jahre vor

Gelöst


Sum of series
a(n) = n^2 - (n-1)^2 find the summation of the series upto n i.e. a(1)+a(2)+...+a(n)

fast 2 Jahre vor

Gelöst


Sum of series VI
What is the sum of the following sequence: Σk⋅k! for k=1...n for different n?

fast 2 Jahre vor

Gelöst


Sum of series IV
What is the sum of the following sequence: Σ(-1)^(k+1) (2k-1)^2 for k=1...n for different n?

fast 2 Jahre vor

Gelöst


Sum of series III
What is the sum of the following sequence: Σ(2k-1)^3 for k=1...n for different n?

fast 2 Jahre vor

Gelöst


Sum of series II
What is the sum of the following sequence: Σ(2k-1)^2 for k=1...n for different n?

fast 2 Jahre vor

Gelöst


Sum of series I
What is the sum of the following sequence: Σ(2k-1) for k=1...n for different n?

fast 2 Jahre vor

Gelöst


Right Triangle Side Lengths (Inspired by Project Euler Problem 39)
If p is the perimeter of a right angle triangle with integral length sides, { a, b, c }, there are exactly three solutions for p...

fast 2 Jahre vor

Gelöst


factorial_calc(n)
Write a MATLAB function called factorial_calc(n) that takes a positive integer n as input and calculates the factorial of n. The...

fast 2 Jahre vor

Gelöst


A (wrong) place for everything, and everything in its (wrong) place
You have an equal number of cups and balls, each labelled from one to N. You randomly place one ball in each cup. Determine th...

fast 2 Jahre vor

Mehr laden