how to save each loop variable in the same vector?
Afficher commentaires plus anciens
hello, every one i have question
i make a loop code to get vi, fi
but, i want to save this vi fi data in the same vector
please let me know how to save result of vi and fi in same vector,
thank you,
%data set = x
n = 24;
for i = 1:numel(x)-n+1
xi = x(i:i+23);
envelope(xi,1,'peak')
[peakHeights,valleyHeights] = envelope(xi,1,'peak')
vi = sum(peakHeights-valleyHeights);
[peakHeights, indexesOfPeaks] = findpeaks (xi);
[valleyHeights, indexesOfValleys] = findpeaks (xi);
fi = [numel(indexesOfPeaks) + numel(indexesOfValleys)]
end
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Signal Generation, Analysis, and Preprocessing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!