How can I join two column data variables and then call that data set to be plot

5 ビュー (過去 30 日間)
David
David 2022 年 7 月 11 日
回答済み: Kshittiz Bhardwaj 2022 年 7 月 13 日
I have two data variables in the form of a column, what I want is to join these two variables and then call it with a single variable.
I need to join x1 and y1 in a single function and then plot as if it were just a variable that contains x1 on the x axis and y1 on the y axis.
I have tried concatenating with the 'cat' command but the values in the figure are not the same.
  3 件のコメント
David
David 2022 年 7 月 11 日
I need to be able to join these two variables to create a single variable that I will later use as a reference, that is what I am looking for
Adam Danz
Adam Danz 2022 年 7 月 11 日
Join them vertically to make 1 column of data (my previous commen) or join them side-by-side into 2 columns (below).
x1y1 = [x1, y1];

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

回答 (1 件)

Kshittiz Bhardwaj
Kshittiz Bhardwaj 2022 年 7 月 13 日
Hello David,
As per my understanding, you want to vertically concatenate 2 variables and call it using a single variable.
You can do that using:
new = [x1;y1];
Alternatively, if you want to join them side-by-side, you can try:
new = [x1 y1];

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by