Where the Four Corners Am I?
The "Four Corners" region of the US is where Colorado, Utah, Arizona, and New Mexico all meet - the only place where four states...
3年以上 前
解決済み
Taylor Series
You can use a Taylor series to approximate common functions. The Taylor series for sin(x) is
Using only the first several te...
Calculate Angle From Axis
Given coordinates x and y, an axis ("X" or "Y"), and a direction ("cw" or "ccw", meaning clockwise and counterclockwise, respect...
Find Closest Constant
Given a number x, return the value that is closest to x from this list of constants: 0, 1, , e, , (also known as ).
For exampl...
3年以上 前
解決済み
Matrix Quadrants
Write a function that takes N as the input, and outputs a matrix whose upper-left (NxN) quadrant contains all ones, the lower-ri...
Calculate the mean of each half of a matrix
Given a matrix with an even number of columns, n, return a 1-by-2 row vector where the first element is the mean of all the elem...
Chess probability
The difference in the ratings between two players serves as a predictor of the outcome of a match (the <http://en.wikipedia.org/...
3年以上 前
解決済み
Energy of a photon
*⚛ ☢ ⚛ ☢ ⚛ ☢ ⚛*
Given the frequency F of a photon in giga hertz.
Find energy E of this...
4年弱 前
解決済み
Get all prime factors
List the prime factors for the input number, in decreasing order. List each factor. If the prime factor occurs twice, list it as...
4年弱 前
解決済み
Crop an Image
A grayscale image is represented as a matrix in MATLAB. Each matrix element represents a pixel in the image. An element value re...
4年弱 前
解決済み
Draw a 'Z'.
Given _n_ as input, generate a n-by-n matrix like 'Z' by _0_ and _1_ .
Example:
n=5
ans=
[1 1 1 1 1
0 0 0 1 ...
4年弱 前
解決済み
Draw a 'X'!
Given n as input Draw a 'X' in a n-by-n matrix.
example:
n=3
y=[1 0 1
0 1 0
1 0 1]
n=4
y=[1 0 0...
4年弱 前
解決済み
Draw a 'N'!
Given n as input, generate a n-by-n matrix 'N' using 0 and 1 .
Example:
n=5
ans=
[1 0 0 0 1
1 1 0 0 1
1 0 ...
4年弱 前
解決済み
Draw 'F'
Draw a x-by-x matrix 'F' using 1 and 0. (x is odd and bigger than 4)
Example:
x=5
ans=
[1 1 1 1 1
1 0 0 0 0
...
4年弱 前
解決済み
Draw 'E'
Draw a x-by-x matrix 'E' using 1 and 0. (x is odd and bigger than 4)
Example:
x=5
ans=
[1 1 1 1 1
1 0 0 0 0
...