รูปแบบการแสดงผลข้อมูล มีผลโดยตรงการการวิเคราะห์ ดังนั้น การแสดงผล Visualization ข้อมูล จึงมีความสำคัญ โดยเฉพาะรูปแบบ 3D

MATLAB BKK
3 min readJan 9, 2023

--

MATLAB BKK CENTER

การสร้างภาพข้อมูลโดยใช้ Matlab สามารถใช้การแสดงแผนผังสามมิติ แปลง 3D หลายประเภท

  1. 3D Points Plot

Matlab Code

rng default

z = linspace(0,4*pi,250);

x = 2*cos(z) + rand(1,250);

y = 2*sin(z) + rand(1,250);

scatter3(x,y,z,…

‘MarkerEdgeColor’,’k’,…

‘MarkerFaceColor’,[0 .75 .75])

view(-30,10)

เราต้องเริ่มจากการ Import ข้อมูลเข้ามาก่อน เพื่อให้อยู่ในรูป Metrix date เช่น csv file

ถ้าต้องการ Save ภาพ นี้ไว้ ได้ด้วย code

saveas(gcf,’My picture.png’)

Matlab Code

x = linspace(0,3*pi,200);

y = cos(x) + rand(1,200);

sz = 25;

c = linspace(1,10,length(x));

scatter(x,y,sz,c,’filled’)

2. 3D line Plot

การแสดงภาพแผนผังเส้น 3 มิติเกือบจะเหมือนกับภาพก่อนหน้า คุณสามารถตรวจสอบส่วนต่างๆ ระหว่างแผนภาพ 3 มิติ กับ พล็อต 3 มิติ ได้ในโค้ดต่อไปนี้

t = 0:pi/300:pi;

xt1 = sin(t).*cos(20*t);

yt1 = sin(t).*sin(20*t);

zt1 = cos(t);

xt2 = 2*sin(t).*cos(12*t);

yt2 = sin(t).*sin(12*t);

zt2 = cos(t);

plot3(xt1,yt1,zt1,xt2,yt2,zt2)

3. 3D contour Plot

เพื่อให้เห็นภาพโครงร่าง เราจำเป็นต้องสร้างตารางสำหรับข้อมูลในแกน x และ y หาก z เป็นผลมาจาก x และ y ในการสร้าง Grid

สามารถเปลี่ยนเฉดสีด้วย Colormap

4. 3D surface Plot

5. 3D surface triangle Plot

6. 3D Plot ร่วมกับ Mesh

clc;

close all;

clear;

N = 500;

X = rand([N,1])*2*pi;

Y = rand([N,1])*2*pi;

Z = sin(X).*cos(Y);

scatter3(X,Y,Z,’.’)

T = delaunay(X,Y)

hold on

trimesh(T,X,Y,Z,”FaceAlpha”,0)

สามารถติดตามเนื้อหาความรู้ต่างๆ โดยเฉพาะการใช้ประยุกต์ใช้กับโปรแกรม Matlab ได้ที่ Facebook Page :(20) Matlab bkk center | Facebook

#กำลังเปิดรับลงทะเบียน

Machine Learning for #Predictive #Maintenance Course

NEURAL NETWORK AND DEEP LEARNING COMPLETE COURSE :

ใครอยากเรียนรู้จากตัวอย่างการ Apply จาก #ProjectMachinelearning ต้องไม่พลาด

#Matlab Code ร่วมแชร์ความรู้ สาระผ่านกลุ่ม ->

(กลุ่ม Facebook Matlab Bkk AI & Data science & Other Classroom)>

https://web.facebook.com/groups/403881684322230/

#matlabbkk

#datascience

#MachineLearning

#รับเขียนโปรแกรมMatlab #ทุกApplication

#จัดอบรมMatlab

#DeepLearning

#matlab

#www.matlabbkk.com

--

--

No responses yet