Getting specific values from 3D matrix
Ältere Kommentare anzeigen
Hi all, I have a 1200x1200x100 matrix and I'm trying to select/crop it using x indicies and y indicies I have found of interest. The all 4 lists of coordinates are 1x34 matrix. I should be getting something like 150x160x100 but running into problems using loops. Thank you for any help!
for N=1:34
xdata(N) = data(X1coordinates(N):X2coordinates(N),Y1coordinates(N):Y2coordinates(N),100);
end
7 Kommentare
Luna
am 9 Jan. 2019
Could you please share the example data( a matrix you want to crop(smaller example)), your x,y coordinates and desired output for them? What are the 4 lists?
Dylan George
am 9 Jan. 2019
Bearbeitet: Dylan George
am 9 Jan. 2019
Hi, thanks for your time. The 4 lists are x1 x2 y1 and y2, each of them are 1x34 matricies. They contain the indicies on the x and y axis id like to crop eg. 2 nd row for each of these lists is 135 , 139 , 560, 567 respectively. Therefore id like a 4x7x100 area of interest for this row. The end goal is to find the area of interests (34 areas thisyouyou ) using the original 'data' 1200x1200x100 to create a time frame i.e a plot of the intensity values in the 'data' against the number of frames in the z axitimes (100). Hope this clears it up a little. Thank
Guillaume
am 9 Jan. 2019
And how do you want to store these frames? If they're all the same size, as a 4D matrix? If they're of different size, as a cell array? Something else?
Dylan George
am 9 Jan. 2019
Bearbeitet: Dylan George
am 9 Jan. 2019
Bob Thompson
am 9 Jan. 2019
What do you mean by "it only works for the first row."?
Dylan George
am 10 Jan. 2019
The first row - meaning x1coordinates(1,1) :coordinates(1,1) and y1coordinates(1,1):y2coordinates(1,1) . Not all 34 rows which I need.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!