Arrange column vetors into table
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Panos Kerezoudis
le 19 Avr 2023
Commenté : Star Strider
le 19 Avr 2023
Hi!
I used the findpeaks function in matlab to find local maxima ('peaks') in a vector and their indices ('locs').
I would like to arrange the two outputs in a table. I used the table function to merge them, but this is what I get, instead of numbers.
I tried converting the variables to num but i didnt help.
Any thoughts?
Thx in advance!
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1361368/image.png)
0 commentaires
Réponse acceptée
Star Strider
le 19 Avr 2023
You simply need to transpose the row vectors to column vectors.
That is best done before creating the table, for example —
peaks = rand(1,11)
locs = sort(randi(25,1,11))
peaks = peaks(:)
locs = locs(:)
A = table(peaks,locs)
.
2 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Tables dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!