extract matrix from matrix with the values of the axis

조회 수: 4 (최근 30일)
Asliddin Komilov
Asliddin Komilov 2020년 8월 14일
댓글: KSSV 2020년 8월 14일
x=linspace(0,8,91);
y=linspace(1,3,56);
I have a matrix DL1 (91x46) and need to extract DL2 =DL1(DL1<=2) and the values of the x and y axis from DL1 corresponding to DL2.
Please help

채택된 답변

KSSV
KSSV 2020년 8월 14일
편집: KSSV 2020년 8월 14일
[m,n] =size(DL1)
x=linspace(0,8,n);
y=linspace(1,3,m);
[X,Y] = meshgrid(x,y) ;
%
idx = DL1<2 ;
idx = idx' ;
iwant = [X(idx) Y(idx)]
  댓글 수: 8
Asliddin Komilov
Asliddin Komilov 2020년 8월 14일
or extract x and y values for the none NaN part of the DL2?
KSSV
KSSV 2020년 8월 14일
X(~idx) = NaN ;
Y(~idx) = NaN ;

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by