MATLAB Answers

ha ha
0

Call pts with z value within a range

Asked by ha ha
on 14 Aug 2019
Latest activity Edited by madhan ravi
on 14 Aug 2019
Let's say, I have matrix A (kx3 matrix): (X,Y,Z coordinate)
A=[1 1 1; 2 2 2; 1 2 1; 9 9 2; 5 5 5; 6 6 6; 3 2 1; 1 1 9; 2 2 8];
A=[1 1 1
2 2 2
1 2 1
9 9 2
5 5 5
6 6 6
3 2 1
1 1 9
2 2 8];
If i want to call matrix B somehow the Z coordinate (value in 3rd column) is satisfy condition (1<Z<9):
result_B=[ 2 2 2; 9 9 2; 5 5 5; 6 6 6; 2 2 8];
How can I do that?

  0 Comments

Sign in to comment.

Tags

1 Answer

Answer by madhan ravi
on 14 Aug 2019
Edited by madhan ravi
on 14 Aug 2019
 Accepted Answer

z = A(:,3);
result_B = A((z>1)&(z<9),:)

  0 Comments

Sign in to comment.