First, find the n nth roots of unity.
eg if n = 6, find the n distinct (complex) numbers such that n^6 = 1.
Second, raise each root to the power pi (.^pi).
Third, sum the resulting numbers and use that as the output.
Surely I shouldn't done this ugly string thing, that is bad for everyone. Without any doubt, Tim's solution is the best one
given 3 sides, find area of this triangle
Back to basics 22 - Rotate a matrix
kmph to mps
Area of an equilateral triangle
Find out sum of prime number till given number
Find left eigenvector of row stochastic matrix
Find argmax of a function
Calculating large fibonacci numbers
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office