Forming a matrix from data
1 view (last 30 days)
Show older comments
Andy Wileman
on 3 Mar 2021
Commented: Andy Wileman
on 3 Mar 2021
Hi,
I think I'm going mad, does anyone know why Matlab will not form a Matrix from the following. I've separated each of the 10 elements with a ; as it says in the help.
Kind regards,
Andy
a=[0.443412162162090
0.443412162162090
0.443412162162090
0.696790540540449
0.570101351351255
0.570101351351255
0.696790540540449
0.823479729729644
0.823479729729644
0.823479729729644;
0.443412162162090
4.11739864864855
10.7052364864864
12.7322635135134
13.4923986486486
14.2525337837837
14.6326013513513
14.6326013513513
15.2660472972972
15.2660472972972;
0.443412162162090
5.51097972972963
23.6275337837837
43.5177364864864
56.1866554054053
62.2677364864864
64.9282094594594
66.9552364864864
68.2221283783783
68.7288851351351;
0.443412162162090
5.63766891891882
27.8082770270270
57.5802364864865
88.1123310810811
110.536317567568
126.372466216216
135.240709459459
140.941722972973
143.855574324324;
0.570101351351225
5.89104729729721
30.3420608108107
45.2913851351350
60.2407094594594
74.9366554054054
105.215371621622
120.291385135135
135.240709459459
149.683277027027;
0.570101351351285
5.89104729729721
33.8893581081080
45.2913851351351
60.2407094594594
75.1900337837838
105.088682432432
120.164695945946
135.367398648649
149.683277027027;
0.570101351351405
6.27111486486491
35.6630067567568
45.2913851351351
60.2407094594594
75.3167229729729
105.342060810811
120.291385135135
135.240709459459
149.809966216216;
0.570101351351465
6.52449324324336
37.4366554054054
45.4180743243243
60.2407094594594
75.3167229729729
105.215371621622
120.291385135135
135.367398648648
149.809966216216;
0.570101351351495
7.03125000000014
39.0836148648649
45.4180743243244
60.2407094594595
75.1900337837838
105.088682432432
120.291385135135
135.367398648648
149.936655405405]
0 Comments
Accepted Answer
Cris LaPierre
on 3 Mar 2021
To put elements on separate rows, you can either put a semicolon between the numbers, or enter them on separate lines. You have done both, so every number is being placed on a separate row. Place elements on the same line that you want in the same row, separated with a comma. Otherwise, use '...' to indicate the row continues on the next line.
a=[0.443412162162090, 0.443412162162090, 0.443412162162090, 0.696790540540449, 0.570101351351255, 0.570101351351255, 0.696790540540449, 0.823479729729644, 0.823479729729644, 0.823479729729644 % doesn't need a semicolon
0.443412162162090, 4.11739864864855, 10.7052364864864, 12.7322635135134, 13.4923986486486, 14.2525337837837, 14.6326013513513, 14.6326013513513, 15.2660472972972, 15.2660472972972; % but you can still use if you want
0.443412162162090, ...
5.51097972972963, ...
23.6275337837837, ...
43.5177364864864, ...
56.1866554054053, ...
62.2677364864864, ...
64.9282094594594, ...
66.9552364864864, ...
68.2221283783783, ...
68.7288851351351; % semicolon used to indicate the end of a row
0.443412162162090, ...
5.63766891891882, ...
27.8082770270270, ...
57.5802364864865, ...
88.1123310810811, ...
110.536317567568, ...
126.372466216216, ...
135.240709459459, ...
140.941722972973, ...
143.855574324324;
0.570101351351225, ...
5.89104729729721, ...
30.3420608108107, ...
45.2913851351350, ...
60.2407094594594, ...
74.9366554054054, ...
105.215371621622, ...
120.291385135135, ...
135.240709459459, ...
149.683277027027;
0.570101351351285, ...
5.89104729729721, ...
33.8893581081080, ...
45.2913851351351, ...
60.2407094594594, ...
75.1900337837838, ...
105.088682432432, ...
120.164695945946, ...
135.367398648649, ...
149.683277027027;
0.570101351351405, ...
6.27111486486491, ...
35.6630067567568, ...
45.2913851351351, ...
60.2407094594594, ...
75.3167229729729, ...
105.342060810811, ...
120.291385135135, ...
135.240709459459, ...
149.809966216216;
0.570101351351465, ...
6.52449324324336, ...
37.4366554054054, ...
45.4180743243243, ...
60.2407094594594, ...
75.3167229729729, ...
105.215371621622, ...
120.291385135135, ...
135.367398648648, ...
149.809966216216;
0.570101351351495, ...
7.03125000000014, ...
39.0836148648649, ...
45.4180743243244, ...
60.2407094594595, ...
75.1900337837838, ...
105.088682432432, ...
120.291385135135, ...
135.367398648648, ...
149.936655405405]
More Answers (0)
See Also
Categories
Find more on Logical in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!