generating a 3d surface from from [x,y,z,c] matrix

Dear all,
I have a dataset in a 8261x4 matrix where the first 3 columns represent x,y,z coordinate and the fourth column vlaues are ones as in the figure below:
thses are sunrays hitting a rectangular surface. the ones represent the power per ray. I want to generate a surface like in the next figure (it is a 2d plot using x&z only):
in the previous figure, the surface devidied by 25x25 (resolution) and the ones in the fourth column in the matrix were summed based on the grid resolution.
I include the y-axis because I have another data for tilted surfaces (3D), the end goal is to plot the flux map on multiple panels (shown in the figure below) and each panel will have a data like the martix I showed previously.
Thank you.

2 commentaires

KSSV
KSSV le 5 Juin 2020
Attach your data.
here is the attached data.
Thank you

Connectez-vous pour commenter.

Réponses (1)

Hey Abdulelah,
I have made some approaches with density3D from:
should do the job for you. I have attached 2 images one with scatter3 and one with density 3D
posXvals = raydata1{:,1}
posYvals = raydata1{:,2};
posZvals = raydata1{:,3};
figure(1)
scatter3(posXvals,posYvals,posZvals);
figure(2)
density3D(posXvals',posZvals');

5 commentaires

Abdulelah Alswaiyd
Abdulelah Alswaiyd le 8 Juin 2020
Modifié(e) : Abdulelah Alswaiyd le 8 Juin 2020
the density3d function is great, but it won't work for me if I want to view all the the five panels' results. the scatter3 didn't show the values (by color) of each area.
Abdulelah Alswaiyd
Abdulelah Alswaiyd le 8 Juin 2020
Modifié(e) : Abdulelah Alswaiyd le 8 Juin 2020
you can see the full data for 5 vertical panels, I plotted it using the scatter3 function but I cannot tell how dense the data is in specific areas:
isometric view.
top view.
the data is attached.
darova
darova le 12 Juin 2020
what about griddata?
Andreas Bernatzky
Andreas Bernatzky le 15 Juin 2020
Modifié(e) : Andreas Bernatzky le 15 Juin 2020
Hey Abduleah,
sorry for my late reply.
If you want to have the density actual as some numeric value for example Rays/Panel you calculate it by Thresholds and extracting correct x and y values. For example what I mean:
The panel in the mid on your isometric view reaches roughly from x: -0.8 to 0.8
easiest approach would be defining thresholds for each panel and find the amount of rays per panel by using the "find()" command.
Rough Exampel:
rayOnMidPanel = find(x>=-0.8 && x<= 0.8);
@darova
should also work yes. I have not thought about it.

Connectez-vous pour commenter.

Produits

Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by