I have a list of objects in matrix A and object list and their corresponding masses in matrix B.Howto generate a matrix containing masses of objects present in orderof matrxA
조회 수: 2 (최근 30일)
이전 댓글 표시
채택된 답변
Voss
2023년 1월 31일
A = ["C"; "A"; "E"; "F"; "I"]
B = ["A", 1;"B", 34;"C" 56;"D" 32;"E",11;"F",8;"G", 7;"H",9;"I" 77]
[ism,idx] = ismember(A,B(:,1));
assert(all(ism))
result = B(idx,:)
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Graphics Object Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!