Finding Particular Values In 3D Plots

3 visualizzazioni (ultimi 30 giorni)
Arjun Tandon
Arjun Tandon il 31 Lug 2019
Commentato: Arjun Tandon il 5 Ago 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.

Risposta accettata

dpb
dpb il 1 Ago 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 Commento
Arjun Tandon
Arjun Tandon il 5 Ago 2019
Thanks DB! I think I was just overwhelmed (it's a long code with a lot of data).

Accedi per commentare.

Più risposte (0)

Tag

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by