Matlab基本函式-cylinder函式
阿新 • • 發佈:2018-12-20
1、cylinder函式:繪製三維圓柱圖
2、用法說明:
(1)[x,y,z]=cylinder 函式返回一半徑和高度都為1的圓柱體x,y,z軸的座標值,圓柱體沿其周長有20個等距分佈的點
(2)[x,y,z]=cylinder(r) 函式一個半徑為r、高度為1的圓柱體的x,y,z軸的座標值,圓柱體沿其周長有20個等距分佈的點
(3)[x,y,z]=cylinder(r,n) 函式一個半徑為r、高度為1的圓柱體的x,y,z軸的座標值,圓柱體沿其周長有n個等距分佈的點
(4)cylinder(...) 函式只繪製圓柱,沒有任何的輸出參量。其他參量及結果同上
3、例項
3.1、[x,y,z]=cylinder 函式
3.2、[x,y,z]=cylinder(r)函式>> [x,y,x] = cylinderx = 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 18 through 21 0 0 0 0 1 1 1 1y = 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 11 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 21 0 0x = 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 18 through 21 0 0 0 0 1 1 1 1
3.3、[x,y,z]=cylinder(r,n) 函式>> [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 11 through 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.0000y = 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 11 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 0z = 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 18 through 21 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 11 through 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.0000y = 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 11 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 0z = 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 18 through 21 0 0 0 0 1 1 1 1
>> [x,y,z]=cylinder(5,10)x = Columns 1 through 10 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 11 5.0000 5.0000y = Columns 1 through 10 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 11 0 0z = 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(...) 函式>> cylinder(5)
繪製的圓柱圖