Separating the Z Vector of a matrix
显示 更早的评论
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"
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Hyperspectral Image Processing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!