Let's say, I have 2 matrix:
A=[1 9 5 6;2 1 4 5;3 4 3 5];
dist_A=[0.1 0.6 0.4 0.5; 0.5 0.1 0.2 0.3; 0.2 0.9 0.7 0.4];
condition=0.5;
A=[1 9 5 6
2 1 4 5
3 4 3 5];
dist_A=[0.1 0.6 0.4 0.5
0.5 0.1 0.2 0.3
0.2 0.9 0.7 0.4];
My question is:
1/ I want to delete values in matrix "dist_A" that satisfy condition: If that value <= condition(0.5)
I hope the result is:
result_dist_A=[0.1 0.4 ; 0.1 0.2 0.3; 0.2 0.4];
2/ Delete the value in matrix A having the same index of the deleted value in matrix "dist_A"
I hope the result is:
result_A=[1 5 ; 1 4 5; 3 5];
1 Comment
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/448090-delete-value-in-matrix-with-condition#comment_677215
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/448090-delete-value-in-matrix-with-condition#comment_677215
Sign in to comment.