Let's we are given a number that we would like to compare it with the whole numbers which are in a column of matrix. For example:
value = 210;
A = [
0.0010 68
0.0011 277
0.0011 129
0.0012 87
0.0015 78
0.0016 248
0.0019 270
0.0019 133
0.0022 258
0.0025 264
0.0029 255
0.0030 81
0.0032 242
0.0033 27
0.0036 124];
Now, we want to compare value
with all the numbers in column two under a condition and if it satisfies for all the numbers in the second column then do some computations otherwise do some other computations. If it does not hold for one then exit and continue code. In the example:
if abs(value - A(:,2)) > 50 % should be true for all A(:,2)
do something
else
do something
How could one write it in code?
Aucun commentaire:
Enregistrer un commentaire