Find elements in a matrix
1 次查看(过去 30 天)
显示 更早的评论
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:
回答(2 个)
Ruger28
2019-11-14
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!