分享興趣,傳播快樂,增長見聞,留下美好。
親愛的您,
這里是LearingYard學苑!
今天小編為大家帶來Matlab三維繪圖(1)介紹,
歡迎您的用心訪問!
本期推文閱讀時長大約3分鐘,請您耐心閱讀。
Share interests, spread happiness, increa knowledge, and leave behind beauty.
Dear you,
this is LearningYard Academy!
Today, the editor brings you introduction of Matlab three-dimensional drawing(1),
welcome your visit carefully!
This tweet will take about 3 minutes to read . Plea read it patiently.
Matlab中的三維圖形包括三維折線及曲線圖、三維曲面圖等。創建三維圖形和創建二維圖形的過程類似,不過,三維圖形能夠設置和標注更多的元素,如顏色過渡、光照和視角等。
The 3D graphics in MATLAB include 3D broken line and curve graphs, 3D surface graphs, etc. The process of creating 3D graphics is similar to creating 2D graphics, however, 3D graphics can t and label more elements, such as color transitions, lighting, and perspective.
01
三維曲線圖
Matlab也提供了一個繪制三維折線或曲線的基本命令plot3,其格式是:plot3(x1,y1,z1,option1,x2,y2,z2,option2,….)
圖像實例1:繪制三維曲線圖,將t定義為由介于0和20π之間的值組成的向量。將x和y定義為正弦和余弦值向量,并添加標題和為x、y、z軸添加標簽。輸入如下代碼:
Matlab also provides a basic command plot3 for drawing three-dimensional polylines or curves. Its format is: plot3(x1,y1,z1,option1,x2,y2,z2,option2,….)
Image Example 1: Plot a 3D graph, defining t as a vector of values between 0 and 20π. Define x and y as vectors of sine and cosine values, and add titles and labels for the x, y, and z axes. Enter the following code:
運行結果如下:
The results are as follows:
圖像實例2:繪制三維螺旋曲線,輸入如下代碼:
Image example 2: To draw a three-dimensional spiral curve. Enter the following code:
運行結果如下:
The results are as follows:
02
三維曲面圖
繪制圖像時,如果是一般方程形式,可以用mesh()函數,surf()函數,函數接受三個參數,分別表示橫,縱和豎坐標。mesh()所繪制圖像,線條有顏色,線條之間無填充;surf()函數線條為黑色,線條之間有填充。如果是參數方程形式,在函數名前面加個f,即調用fmesh(),fsurf()。
圖像實例3:繪制三維曲面圖,將x定義為由介于0和2π之間的值組成的向量,并添加標題和為x、y、z軸添加標簽。輸入如下代碼:
When drawing an image, if it is in the form of a general equation, you can u the mesh() function and the surf() function. The function accepts three parameters, reprenting the horizontal, vertical and vertical coordinates respectively. In the image drawn by mesh(), the lines are colored, and there is no filling between the lines; the lines of the surf() function are black, and there is filling between the lines. If it is in the form of a parametric equation, add an f in front of the function name, that is, call fmesh(), fsurf().
Image Example 3: Plot a 3D surface plot, define x as a vector of values between 0 and 2π, and add titles and labels for the x, y, z axes. Enter the following code:
運行結果如下:
The results are as follows:
sphere()函數用于生成半徑為1的球面,返回值為球面各點x,y,z坐標,可進一步用于surf()和mesh()函數。
圖像實例4:使用sphere函數繪制三維球體圖像,輸入如下代碼:
The sphere() function is ud to generate a sphere with a radius of 1, and the return value is the x, y, and z coordinates of each point on the sphere, which can be further ud in the surf() and mesh() functions.
Image example 4: U the sphere function to draw a three-dimensional sphere image.Enter the following code:
運行結果如下:
The results are as follows:
今天的分享就到這里了。如果您對今天的文章有獨特的想法,歡迎給我們留言,讓我們相約明天。祝您今天過得開心快樂!
That's all for today's sharing.If you have a unique idea for today’s article,plea leave us a message,and let us meet tomorrow.I wish you a happy day !
END
本文發布于:2023-02-28 20:14:00,感謝您對本站的認可!
本文鏈接:http://m.newhan.cn/zhishi/a/167766474482377.html
版權聲明:本站內容均來自互聯網,僅供演示用,請勿用于商業和其他非法用途。如果侵犯了您的權益請與我們聯系,我們將在24小時內刪除。
本文word下載地址:matlab 畫圖(matlab畫圖怎么設置坐標軸范圍).doc
本文 PDF 下載地址:matlab 畫圖(matlab畫圖怎么設置坐標軸范圍).pdf
| 留言與評論(共有 0 條評論) |