Merge 2 columns with strings

조회 수: 1 (최근 30일)
Alexander Guillen
Alexander Guillen 2022년 6월 16일
편집: Carson Purnell 2022년 6월 16일
Hello,
I have been trying to look if someone else had a similar question. But not sucess so I want to ask. How would you approach merging two columns with strings as the picture below? Thanks in advance
  댓글 수: 1
Dyuman Joshi
Dyuman Joshi 2022년 6월 16일
How is your data imported in MATLAB? This looks like Excel.

댓글을 달려면 로그인하십시오.

채택된 답변

Carson Purnell
Carson Purnell 2022년 6월 16일
편집: Carson Purnell 2022년 6월 16일
given column 1==A and column 2==B, this stacks those columns without sorting.
%example arrays
A = {'a',1;'b',2}; B = {'c',11;'n',12};
vertcat(A,B)
Pretty simple. But it is unclear what your data is, how it is organized, or what your specific intent is. Please provide more details.
  댓글 수: 6
Alexander Guillen
Alexander Guillen 2022년 6월 16일
I have seen like two other people ask this question, and they dont get any answer. I will keep trying - it is nothing crucial- it is just to save me time.
Carson Purnell
Carson Purnell 2022년 6월 16일
편집: Carson Purnell 2022년 6월 16일
You don't need to keep trying, if you read my comment I have provided the code to do it. Just inches upward on the screen. Make sure to read the documentation on vertcat.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by