필터 지우기
필터 지우기

Extracting data from two tables with the same ID's

조회 수: 2 (최근 30일)
M
M 2021년 5월 17일
댓글: M 2021년 5월 18일
I have two tables:
So they are different size, and ID's from first columns are the same identificators. I would like to extend the table Selected_Processess, so in 3rd column I'd parameter amount_of_occurences from table Processes(:,2) but just for shared ID's from first columns, so for example for the first 2 rows(only this two are visible and shared ID's between the tables in those screenshots) it would look like:
table = [2 2 6;
15 1 4]
After this, the table should have size 228x3.
I was doing similar thing with strings inside cellarray, and function isamember worked perfectly, but for integers it's different.
Ps. I don't mind changing this data from table to any other form such as cell, etc. as long as it would work as I need.
Thanks in advance for your help :)
  댓글 수: 1
the cyclist
the cyclist 2021년 5월 17일
Are you able to upload the data, so we can test suggested code?

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

채택된 답변

the cyclist
the cyclist 2021년 5월 17일
I didn't completely follow what you are trying to do, but I'm pretty sure you should be able to use the join command to do what you want.
  댓글 수: 1
M
M 2021년 5월 18일
Thank you, this is exactly what I needed :)

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by