How can I join two column data variables and then call that data set to be plot
조회 수: 7 (최근 30일)
이전 댓글 표시
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1061890/image.png)
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
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
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];
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!