I want to save values from my if statement in an array
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Sam17
am 14 Jun. 2018
Beantwortet: Walter Roberson
am 14 Jun. 2018
I am trying to save values of the peakInterval which lies in between 550 and 900 to a separate array. I don't know why this code doesn't save the values in the x array. Can you fix the problem?
x=[]
if (peakInterval >= 550) & (peakInterval<=900)
x=peakInterval
end
x(:)=[]
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 14 Jun. 2018
mask = (peakInterval >= 550) & (peakInterval<=900);
x = peakInterval(mask);
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Fluid Dynamics finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!