Extracting value from array and determine it position
Mostra commenti meno recenti
suppose i have this table.
How do i determine how many days the temp in lake A was above 60 and on what day its happen? I use this commands but it doesnt satisfy my question.
temp_A=[55 62 60 61 63 65 62 59 58 56];
x=find(temp_A>60)
position=temp_A(x)
4 Commenti
David Fletcher
il 7 Mag 2021
Modificato: David Fletcher
il 7 Mag 2021
Depends on what you mean by 'what day does it happen' - if you mean the first day it went above 60, then it will relate to the first value of x. Providing the days always increment from 1 by a single day then it will just be the value of x(1) - otherwise you will have to use the value of x(1) to index the day. The number of days above 60 is just the number of elements in x
Amril Luqman
il 7 Mag 2021
Matt J
il 7 Mag 2021
I edited your post to show the results of running your computation. It seems to give exactly the results you say you expect. Are you seeing something different?
Amril Luqman
il 7 Mag 2021
Risposte (0)
Categorie
Scopri di più su Matrix Indexing in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!