How to find values from data
8 次查看(过去 30 天)
显示 更早的评论
When using if statements, I am trying to find a set of data that fits the condition I have given. How can I find where the data with the right conditions is located?
0 个评论
回答(1 个)
KSSV
2021-12-12
You can use logical indexing.
Example:
A = rand(10,1) ; % data for demo
idx = A > 0.3 & A < 0.8 ;
idx
find(idx)
A(idx)
5 个评论
Star Strider
2021-12-12
What are the row and column sizes are the two data sets? Do they have common times (or any other specific identifying row information)?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Problem-Based Optimization Setup 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!