Move selected column from a matrix to another
이전 댓글 표시
Hello Matlab community,
I am a beginner in Matlab.
I have a matrix M, I would like to select from this matrix the columns which have a value between Xmin and Xmax in the lign 310 and also value between Ymin and Ymax in the lign 620. Then copied the columns selected in a new matrix. Below, it's the code I tried, however the answer is that all the colums are copied into the matrix x.
Xmin = 429500;
Xmax = 431500;
Ymin = 5907000;
Ymax = 5910000;
n = 7000;
dt = 620;
x = zeros(dt,n);
y = zeros(dt,n);
for in=1:n
if Xmin>= M(310,in)<= Xmax & Ymin>=M(620,in)<= Ymax;
x(:,in) = M(:,in);
else
x(:,in) = x(:,in);
end
end
Can someone help me please?
Regards
Jonathan
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!