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!