필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

compare a number to an other matrix

조회 수: 1 (최근 30일)
Mo Das
Mo Das 2019년 5월 24일
마감: MATLAB Answer Bot 2021년 8월 20일
A=[ 0.2230 0.2769 0.4342 0.5916
0.8142 1.0223 1.2754 1.5220
3.4634 4.0496 4.6448 4.9931
4.0816 4.6988 5.3160 5.5607
4.6499 5.2839 5.9179 6.0586
5.1968 5.8464 6.4960 6.4960]
B=[ 1.8189 2.5984 3.7677 5.3267 5.7165 6.4960 ]
i have 2 matrixes A and B. i want to write a loop to compare number from mat A in each row to mat B that the number is between 2 number in matrix B.
for example in mat A , a31 = 3.4634 and it is between b12 ans b13 .
so i have a third matrix with 4 items .
[ 2 (where the A number is bigger than B number ) 2.5984 ( smaller number in mat B) 3.7677 (bigger item in mat B) 3.4634(number that compared from mat A to mat B)]
i dont know i say clear or not . i dont know how to write the loop and how to put the numbers in the third matrix . :(
  댓글 수: 2
Geoff Hayes
Geoff Hayes 2019년 5월 24일
Mo - why just four items in the third matrix? Wouldn't there be 5? Numbers between
1.8189 2.5984
2.5984 3.7677
3.7677 5.3267
5.3267 5.7165
5.7165 6.4960
Mo Das
Mo Das 2019년 5월 24일
i have a formula that it uses 4 items . place that number in mat B is smaller than number in mat A.
smaller and bigger numbers in mat B .
and number in mat A has been compared with mat B. i want to get this items at the end . i tought matrix with 4 items must be perfect

답변 (0개)

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by