Plotting (x,y,z) and Pressure

18 vues (au cours des 30 derniers jours)
Kerby
Kerby le 15 Sep 2020
Commenté : Kerby le 16 Sep 2020
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!

Réponse acceptée

BOB MATHEW SYJI
BOB MATHEW SYJI le 15 Sep 2020
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 commentaire
Kerby
Kerby le 16 Sep 2020
Thank you so much!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Lighting, Transparency, and Shading dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by