Merge multiple cells into one cell array
古いコメントを表示
I have a three different cell arrays for my DMS (degree, minute, second). I want to combine it into one cell into the DMS format (degree°minute'second"). The second(") data is a decimal number while degree and minutes are integers.
I have a data of like this:
Degrees (19x1) = 128
128 ......
Minutes (19x1) = 34
32....
Seconds (19x1)= 14.651
40.654
How can I combine this three cell arrays into a form such that:
128°34'14.651"
128°32'40.654"
this is what I want to be the result.
回答 (1 件)
n = 3;
Degrees = randi([0 359], [n, 1])
Minutes = randi([0 59], [n, 1])
Seconds = rand([n, 1])*60
s = compose("%d%c%d%c%.4f%c", Degrees, char(176), Minutes, "'", Seconds, '"')
カテゴリ
ヘルプ センター および File Exchange で Lengths and Angles についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!