Array to table not working after forming matrix
조회 수: 3 (최근 30일)
이전 댓글 표시
altitude = [ 5 10 15 20 25 30 35 40 45 50 55 60 65 ];
flux_up = [ 35 55 80 110 125 130 140 150 155 175 225 275 325];
flux_down = [ 50 75 100 125 150 155 170 175 180 225 275 325 380 ];
matrix = [transpose(altitude); transpose(flux_up); transpose(flux_down) ]
table = array2table(matrix)
But I am getting a 39x1 table and it should be a table with 3 columns and 13 rows
댓글 수: 0
답변 (2개)
Walter Roberson
2017년 7월 30일
You have
matrix = [transpose(altitude); transpose(flux_up); transpose(flux_down) ]
You need
matrix = [transpose(altitude), transpose(flux_up), transpose(flux_down) ]
댓글 수: 0
John BG
2017년 7월 30일
Hi Mr Kennedy
Do you mean this?
altitude = [ 5 10 15 20 25 30 35 40 45 50 55 60 65 ]';
flux_up = [ 35 55 80 110 125 130 140 150 155 175 225 275 325]';
flux_down = [ 50 75 100 125 150 155 170 175 180 225 275 325 380 ]';
T=table(altitude,flux_up,flux_down)
T =
13×3 table
altitude flux_up flux_down
________ _______ _________
5 35 50
10 55 75
15 80 100
20 110 125
25 125 150
30 130 155
35 140 170
40 150 175
45 155 180
50 175 225
55 225 275
60 275 325
65 325 380
if you find this answer useful would you please be so kind to consider marking my answer as Accepted Answer?
To any other reader, if you find this answer useful please consider clicking on the thumbs-up vote link
thanks in advance
John BG
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!