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 Kommentare

Is this a homework?
Kimberly
Kimberly am 20 Apr. 2014
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.
Star Strider
Star Strider am 20 Apr. 2014
See the gt function and its friends (all linked-to at the end of the page).
Kimberly
Kimberly am 21 Apr. 2014
I just ended up using the find function for the matrix and it worked

Antworten (1)

Walter Roberson
Walter Roberson am 21 Apr. 2014

0 Stimmen

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

Diese Frage ist geschlossen.

Gefragt:

am 20 Apr. 2014

Geschlossen:

am 20 Aug. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by