Arrange column vetors into table
조회 수: 4 (최근 30일)
이전 댓글 표시
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
채택된 답변
Star Strider
2023년 4월 19일
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Tables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!