I don't understand this command : F=find(B>4)
1 vue (au cours des 30 derniers jours)
Cris LaPierre le 16 Mai 2023
That looks correct. What is it you are expecting?
Since the output is returning a single index for each value found, it is uslng linear indexing. You can read more about that here: https://www.mathworks.com/help/matlab/math/array-indexing.html#MatrixIndexingExample-2
If you prefer row & column index, use the following syntax
You can read more about the find function here: https://www.mathworks.com/help/matlab/ref/find.html
Paul le 16 Mai 2023
B is a 2D matrix.
B=[1 2 3 4; 5 6 7 8]
This command finds the "linear indices" of the elements of B that satisfy the criteria
The linear indices are the indices of B when it's viewed a s 1D vector formed by vertically concatenating its columns, which can be shown as
The 2nd, 4th, 6th, and 8th elements of B(:) are the elements greater than 4