accessing data in multiple pixels (x,y) in 3D matrix (t,x,y)
1 view (last 30 days)
Show older comments
Hi,
I am a beginner in Matlab. I am trying to average time series (t) of selected multiple pixels in 3D matrix (t,x,y). I could obtain two 1D vectors for x and y indexes, but have problems when accessing 1D time series data for all the selected pixels in 3D matrix. Would someone know how to do that without using loop?
Best,
0 Comments
Accepted Answer
Iain
on 22 May 2013
Matrix_2D = reshape(Matrix_3D,[timesamples numberofpixels]);
Determine the pixel numbers you want (1 = top left, 2 = 1 below that... etc.) and put them in a vector. "V"
Selected_pixel_timeseries = Matrix_2D(:,V);
You can then simply take the mean of each row to get the average of each frame.
See Also
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!