How do I write a statement that will discard any values in an array if they are over a certain value?
조회 수: 3 (최근 30일)
이전 댓글 표시
I want to say that if my height variable is > 1 then not to return the value in my matrix?
댓글 수: 3
José-Luis
2013년 5월 16일
It is easier to import everything to Matlab and then do the processing. Alternatively you could preprocess in Excel if you are more comfortable doing that.
답변 (1개)
Ken Atwell
2013년 5월 16일
I think you're looking for logical indexing:
heights = .1:.3:2
heights < 1
heights(heights<1)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!