Ratio of circle's circumference to its diameter
Value of Pi
Return the value of π in double precision, which has 15 digits after the decimal point.
format long p = pi
p = 3.141592653589793
Area of Circle
Calculate the area of a circle with radius
r = 7; A = pi*r^2
A = 153.9380
Surface Area and Volume of Sphere
Calculate the surface area and volume of a sphere with radius
r = 5; SA = 4*pi*r^2
SA = 314.1593
V = 4/3*pi*r^3
V = 523.5988
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Run code in the background using MATLAB®
backgroundPool or accelerate code with Parallel Computing Toolbox™
This function fully supports thread-based environments. For more information, see Run MATLAB Functions in Thread-Based Environment.
Introduced before R2006a