Find elements in a matrix
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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:
1 Kommentar
Antworten (2)
Ruger28
am 14 Nov. 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 Kommentare
Siehe auch
Kategorien
Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!