Effacer les filtres
Effacer les filtres

Finding Particular Values In 3D Plots

7 vues (au cours des 30 derniers jours)
Arjun Tandon
Arjun Tandon le 31 Juil 2019
Commenté : Arjun Tandon le 5 Août 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.

Réponse acceptée

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

Connectez-vous pour commenter.

Plus de réponses (0)

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by