Find elements in a matrix
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
The task is to find how many of the elements in A is numbers between 30 and 65, how do I find that? My code looks like this:
![Skärmavbild 2019-11-14 kl. 15.23.15.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/248265/Sk%C3%A4rmavbild%202019-11-14%20kl.%2015.23.15.png)
1 comentario
Respuestas (2)
Ruger28
el 14 de Nov. de 2019
This really isnt code, or even an attempt....but
A = randi([10,100],8,20);
B = A(A>=30 & A <= 65); % logically index A using your limits
using FIND
A = randi([10,100],8,20);
C = find(A>=30 & A<=65); % get index of values in your window
D = A(C); % get values in A
0 comentarios
Ver también
Categorías
Más información sobre Matrices and Arrays en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!