Plotting (x,y,z) and Pressure

조회 수: 18 (최근 30일)
Kerby
Kerby 2020년 9월 15일
댓글: Kerby 2020년 9월 16일
Hello, I am trying to create a 3D plot of an object with a pressure gradient associated with that object. I have a .txt file with 4 columns ( X, Y, Z, Pressure). In total the matrix is (85,000 x 4). I have tried looking at examples posted online and using MATLAB documentation but I am unable to successfully plot anything.
Thanks!

채택된 답변

BOB MATHEW SYJI
BOB MATHEW SYJI 2020년 9월 15일
Hi, Hope this helps.This code visualises the data as scatter plot.
%dat is your data file
x = dat(:,1);
y = dat(:,2);
z = dat(:,3);
Pressure = dat(:,4);
scatter3(x,y,z,40,Pressure,'filled')
ax = gca;
ax.XDir = 'reverse';
view(-31,14)
xlabel('x')
ylabel('y')
zlabel('z')
cb = colorbar;
cb.Label.String = 'Pressure';
  댓글 수: 1
Kerby
Kerby 2020년 9월 16일
Thank you so much!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Scatter Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by