how many elements lie between 20 and 30

Hello everyone can you please help in finding. How many elements lie between 20 and 30 ?
I want to know the command ?

답변 (1개)

Image Analyst
Image Analyst 2013년 11월 25일

0 개 추천

What form are your numbers in? A vector y? Maybe this:
logicalIndexes = y > 20 & y < 30;
firstElement = find(logicalIndexes, 1, 'first');
lastElement = find(logicalIndexes, 1, 'last');
numberOfElements = lastElement - firstElement + 1;
but it really depends on what your data is doing and what you're after. That's just one possible interpretation. Please clarify by giving an example.

카테고리

태그

질문:

2013년 11월 25일

답변:

2013년 11월 25일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by