how to merge two matrix to one matrix ?

1 回表示 (過去 30 日間)
Reema Alhassan
Reema Alhassan 2018 年 7 月 3 日
コメント済み: Reema Alhassan 2018 年 7 月 3 日
I have x and y coordinates I need to merge them into one matrix having the size: Mx2
x=[50.2124 50.2133 50.2134 50.2134 50.2137];
y=[26.385 26.386 26.387 26.388 26.3859];
I need element 1 from x with element 1 with y and so on ... how can I do this?

採用された回答

Stephen23
Stephen23 2018 年 7 月 3 日
編集済み: Stephen23 2018 年 7 月 3 日
m = [x(:),y(:)]
e.g.:
>> x = [50.2124,50.2133,50.2134,50.2134,50.2137];
>> y = [26.385, 26.386, 26.387, 26.388, 26.3859];
>> m = [x(:),y(:)]
m =
50.212 26.385
50.213 26.386
50.213 26.387
50.213 26.388
50.214 26.386
  2 件のコメント
Reema Alhassan
Reema Alhassan 2018 年 7 月 3 日
Thank you!!
Reema Alhassan
Reema Alhassan 2018 年 7 月 3 日
can I ask you another question I have a matrix s which has the size : 2882x2575 then I convert it to 7421150x1 by this
s1=s(:);
and I did some process...
now I need to convert it back to 2882x2575 how can I do this ?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeComputational Geometry についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by