解決済み


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

1年以上 前

解決済み


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

1年以上 前

解決済み


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

1年以上 前

解決済み


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

1年以上 前

解決済み


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

1年以上 前

解決済み


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

1年以上 前

解決済み


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

1年以上 前

解決済み


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

1年以上 前

解決済み


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

1年以上 前

解決済み


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

1年以上 前

解決済み


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

1年以上 前

解決済み


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

1年以上 前

解決済み


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

1年以上 前

解決済み


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

1年以上 前

解決済み


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

1年以上 前

解決済み


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

1年以上 前

解決済み


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

1年以上 前

解決済み


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

1年以上 前

解決済み


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

1年以上 前

解決済み


Sum of series VIII

1年以上 前

解決済み


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?

1年以上 前

解決済み


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)

1年以上 前

解決済み


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

1年以上 前

解決済み


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?

1年以上 前

解決済み


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

1年以上 前

解決済み


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

1年以上 前

解決済み


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

1年以上 前

解決済み


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

1年以上 前

解決済み


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

1年以上 前

解決済み


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

1年以上 前

さらに読み込む