Finding Particular Values In 3D Plots

3 visualizaciones (últimos 30 días)
Arjun Tandon
Arjun Tandon el 31 de Jul. de 2019
Comentada: Arjun Tandon el 5 de Ag. de 2019
I have a very large matrix (62x60x1000) that represents x and y spatial coordinates, and 1000 frames (time coordinates). I was able to plot this data using the surf and drawnow commands; this plot revealed peaks and troughs in my data in the z-axis. I want to find the average of the peaks and troughs. I have attached a sample of the code I am using and the methodology:
%Data is a data structure I successfully imported from a .mat file.
WF=Data.WF; %Extracts the Wavefront data from the Data structure and forms the WF matrix.
%Note: The WF data is a 3D matrix with x,y,and t domains. The WF matrix is 62x60x1000.
frames=1000; %This corresponds to the number of frames to plot
figure(1)
for i=1:frames
surf(WF(:,:,i));
grid on;
xlabel('x')
ylabel('y')
zlabel('z')
drawnow
end
The code basically plays a movie as it iterates through the one thousand frames (it's not an actual movie). In the z-direction, there are peaks and troughs; the x-y directions form a shape and stay constant. I am interested in finding the average value of the data in the z-direction throughout all time (i.e. the average z-value for the 1000 frames). Below is an image of example data I am working with.

Respuesta aceptada

dpb
dpb el 1 de Ag. de 2019
"... finding the average value of the data in the z-direction throughout all time (i.e. the average z-value for the 1000 frames)"
Z=mean(WF,3);
That was tough, wasn't it... :)
  1 comentario
Arjun Tandon
Arjun Tandon el 5 de Ag. de 2019
Thanks DB! I think I was just overwhelmed (it's a long code with a lot of data).

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by