Array to table not working after forming matrix
1 view (last 30 days)
Show older comments
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 Comments
Answers (2)
Walter Roberson
on 30 Jul 2017
You have
matrix = [transpose(altitude); transpose(flux_up); transpose(flux_down) ]
You need
matrix = [transpose(altitude), transpose(flux_up), transpose(flux_down) ]
0 Comments
John BG
on 30 Jul 2017
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 Comments
See Also
Categories
Find more on Data Type Conversion in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!