Assign partnames to two different tables with measurement datas

1 Ansicht (letzte 30 Tage)
Eucalyptusoil
Eucalyptusoil am 26 Okt. 2021
Beantwortet: Akira Agata am 1 Nov. 2021
Hi, I'm pretty new in matlab and I'm working on my skills during an internship. Now I have a problem, what seems a little more specific than most of similar problems, which is why I didn't find a solution on here. I have two differents tables with one column in both tables has the listnames of parts like for example 'M1'. One Table is the partlist with general informations, the other list has the measurement data of the specific part.
How can i search for the partname and get a new table or maybe matrix, were the partnames lists with general informations and measurement datas? It could be that the names dont follow a specific order or don't exist in both. For Example i'd wish something like that (sorry for my missing skills):
Table 1: Table 2: = new Table 3:
Name Date Name: Temperature: Name: Date: Temperature:
M2 23.03.21 M3 278 M1 20.03.21 293
M1 20.03.21 M2 293 M2 23.03.21 278
M3 25.03.21 M1 280 M3 25.03.21 280
I tried to create a new table 4 at first with only the PartNames and then run a for loop like that to finde the row indices.
for i = 1:n
rowNumber1 = find(contains(table1.Name, table4(i,1)));
rowNumber2 = find(contains(table2.Name, table4(i,1)));
end
Then i'd use the rowNumbers to add together the specific rows. So far with my idea but I'm really overwhelmed with this problem.

Antworten (1)

Akira Agata
Akira Agata am 1 Nov. 2021
I wouold recommend using innerjoin or outerjoin functions for this kind of task.

Produkte


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by