find the values of a that are between 2 and 6(inclusive)

3 ビュー (過去 30 日間)
marie
marie 2012 年 12 月 4 日
A>>
7.24 0.80 *7.31* *9.24* *3.09*
1.06 0.06 *8.97* *1.37* *0.55*
8.67 8.88 *9.92* *0.71* *0.90*
3.45 9.01 *9.15* *4.80* *2.29*
4.56 5.16 *5.33* *7.10* *7.61*
1.16 0.64 *0.08* *8.76* *8.06*
8.96 6.23 *9.96* *6.93* *7.71*
8.15 6.84 *6.95* *1.88* *7.36*
4.75 1.54 0.28 3.10 9.04
[r,c]=find(A<=2 & A<=6) is this right?

採用された回答

Image Analyst
Image Analyst 2012 年 12 月 4 日
Some things to try:
A=[7.24 0.80 7.31 9.24 3.09
1.06 0.06 8.97 1.37 0.55
8.67 8.88 9.92 0.71 0.90
3.45 9.01 9.15 4.80 2.29
4.56 5.16 5.33 7.10 7.61
1.16 0.64 0.08 8.76 8.06
8.96 6.23 9.96 6.93 7.71
8.15 6.84 6.95 1.88 7.36
4.75 1.54 0.28 3.10 9.04]
linearIndexes = A>=2 & A<=6;
[rows, columns]=find(linearIndexes)
inRange = A(linearIndexes)

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2012 年 12 月 4 日
Any value that is <= 2 will also be <= 6 . Reconsider your comparisons.

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by