Separating the Z Vector of a matrix
Mostra commenti meno recenti
Say we have a Data Cube that is 768x320x361(i.e. X, Y, Z coordinates). I generate 2 variable list called VarName1 and VarName2 that hold X and Y coordinates. My goal is to get only the first 124 values of the Z vector at each X and Y point and assign the values to columns. Here is the code I have wrote so far
pixswir=zeros(361,12);
for i = 1:12
%grabs all the pixel values in the z direction
pix = img(VarName2(i),VarName1(i),:);
pixswir(:,i)=pix(:);
end
This will return a matrix 361 x 12 but I only want to grab the first 124 data points of the Z vector and assign them to pixswir so that i have a 124 x 12 matrix. The rest of the values i wish to assign to pixVnir in a 231 x 12 matrix( NOTE:the points on the Z vector 125 to 129 are transition data that is not needed). Any help would be grateful I have tried a few things and keep getting "Subscripted assignment dimension mismatch"
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Hyperspectral Image Processing in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!