MATLAB Basic function-cylinder function

Source: Internet
Author: User

1, cylinder function: Draw three-dimensional cylinder diagram

2. Usage Description:

(1) [X,y,z]=cylinder function returns the coordinate value of the x, Y, Z axis of a cylinder with a radius and height of 1, and a cylinder with 20 equidistant distribution points along its circumference

(2) [X,y,z]=cylinder (R) function A coordinate value for the x, Y, Z axis of a cylinder with a radius of R, 1, and a cylinder with 20 equidistant distributions along its perimeter.

(3) [X,y,z]=cylinder (r,n) function A coordinate value for the x, Y, Z axis of a cylinder with a radius of R, 1, and a cylinder along its Zhou Changyou n equidistant Distribution point

(4) The cylinder (...) function only draws a cylinder without any output parameters. Other parameters and results ibid.

3. Example

3.1, [X,y,z]=cylinder function

>> [X,y,x] = cylinder x = Columns 1 through 17 0 0 0 0 0 0 0 0 0 0     0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1  1 1 1 1 Columns through 0 0 0 0 1 1 1 1 y = Columns 1 through 10 0 0.3090 0.5878 0.8090 0.9511 1.0000 0.9511 0.8090 0.5878 0.3090 0 0.   3090 0.5878 0.8090 0.9511 1.0000 0.9511 0.8090 0.5878 0.3090 Columns one through 20 0.0000   -0.3090-0.5878-0.8090-0.9511-1.0000-0.9511-0.8090-0.5878-0.3090 0.0000-0.3090-0.5878 -0.8090-0.9511-1.0000-0.9511-0.8090-0.5878-0.3090 Column 0 0 x = Columns
     1 through 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0     1 1 1 11 1 1 1 1 1 1 1 1 1 1 1 1 Columns through 21 0 0 0 0 1 1) 1 1
3.2, [X,y,z]=cylinder (R) function

>> [X,y,z]=cylinder (5) x = Columns 1 through 10 5.0000 4.7553 4.0451 2.9389 1.5451 0.0000 -1.5451-2.9389-4.0451-4.7553 5.0000 4.7553 4.0451 2.9389 1.5451 0.0000-1.5451-2.9389- 4.0451-4.7553 Columns through 20-5.0000-4.7553-4.0451-2.9389-1.5451-0.0000 1.5451 2.938 

  9 4.0451 4.7553-5.0000-4.7553-4.0451-2.9389-1.5451-0.0000 1.5451 2.9389 4.0451 4.7553    Column 5.0000 5.0000 y = Columns 1 through 10 0 1.5451 2.9389 4.0451 4.7553 5.0000 4.7553 4.0451 2.9389 1.5451 0 1.5451 2.9389 4.0451 4.7553 5.0000 4.7553 4    .0451 2.9389 1.5451 Columns through 20 0.0000-1.5451-2.9389-4.0451-4.7553-5.0000-4.7553   -4.0451-2.9389-1.5451 0.0000-1.5451-2.9389-4.0451-4.7553-5.0000-4.7553-4.0451-2.9389

-1.5451 Column 21         0 0 z = Columns 1 through 17 0 0 0 0 0 0 0 0 0 0 0     0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns through 0 0 0 0 1 1 1 1>> [X,y,z]=cylinder (5) x = Columns 1 through 10 5.0000 4.7553 4.0451 2.9389 1.5451 0.0000-1.5451-2.9389-4.0451-4 .7553 5.0000 4.7553 4.0451 2.9389 1.5451 0.0000-1.5451-2.9389-4.0451-4.7553 Columns one T    Hrough 20-5.0000-4.7553-4.0451-2.9389-1.5451-0.0000 1.5451 2.9389 4.0451 4.7553-5.0000 -4.7553-4.0451-2.9389-1.5451-0.0000 1.5451 2.9389 4.0451 4.7553 Column 21 5.0000 5. 0000 y = Columns 1 through 10 0 1.5451 2.9389 4.0451 4.7553 5.0000 4.7553 4.0451 2.
         9389 1.54510 1.5451 2.9389 4.0451 4.7553 5.0000 4.7553 4.0451 2.9389 1.5451 Columns one through 20 0.0000-1.5451-2.9389-4.0451-4.7553-5.0000-4.7553-4.0451-2.9389-1.5451 0.0000-1.5451-2 .9389-4.0451-4.7553-5.0000-4.7553-4.0451-2.9389-1.5451 Column 0 0 z = C     Olumns 1 through 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Columns THR Ough 21 0 0 0 0 1 1 1 1
3.3, [X,y,z]=cylinder (r,n) function

>> [X,y,z]=cylinder (5,10)

x =

  Columns 1 through

    5.0000    4.0451    1.5451   -1.5451   - 4.0451   -5.0000   -4.0451   -1.5451    1.5451    4.0451
    5.0000    4.0451    1.5451   - 1.5451   -4.0451   -5.0000   -4.0451   -1.5451    1.5451    4.0451

  Column

    5.0000
    5.0000


y =

  Columns 1 through

         0    2.9389 4.7553    4.7553    2.9389    0.0000   -2.9389   -4.7553   -4.7553   -2.9389
         0    2.9389    4.7553    4.7553    2.9389    0.0000   -2.9389   -4.7553   -4.7553   -2.9389

  Column

         0 0


z =

     0     0     0     0     0     0     0     0     0     0     0
     1     1     1     1     1     1     1     1     1     1     1
3.4. Cylinder (...) function

>> Cylinder (5)
Drawing a cylinder diagram




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.