Returning values in a matrix between 1 and 2

how would I write a script that returns the values in a matrix between 1 and 2. both using for loops and not.

댓글 수: 4

Is this a homework?
Kimberly
Kimberly 2014년 4월 20일
yes I have to make a random matrix, which I already did, then write a script for it to return the values between 1 ans 2 one not using loops and one using 2 for loops.
See the gt function and its friends (all linked-to at the end of the page).
Kimberly
Kimberly 2014년 4월 21일
I just ended up using the find function for the matrix and it worked

답변 (1개)

Walter Roberson
Walter Roberson 2014년 4월 21일

0 개 추천

See also logical indexing
values = YourMatrix(YourMatrix > 1 & YourMatrix < 2);

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

질문:

2014년 4월 20일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by