How to combine matrices with different size but preserve elements with same value?
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have 4 columns of data which are FEM element number that share the same node (the elements are tetrahedron, hence 4 nodes) with one specific element, I want to merge them into one column so that when I select one element I can get all the elements that are connected with selected element.
for example
A= [1; 5; 8; 9], B=[1; 2; 4; 5; 7; 9]
and I want to get C=[1; 2; 4; 5; 7; 8; 9]
Is this possible?
0 Commenti
Risposta accettata
Più risposte (2)
Steven Lord
il 9 Giu 2021
None of A, B, or C have four columns like you stated you had.
You didn't indicate how you generated C from A and B, but one way to do so:
A= [1; 5; 8; 9];
B=[1; 2; 4; 5; 7; 9];
C = union(A, B)
whos A B C % 1 column each
Vedere anche
Categorie
Scopri di più su Matrices and Arrays in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!