How to edit 2 matrices
이전 댓글 표시
Hi everybody,
I have a matrix which is A = [1; 2; 5; 8; 9; 10; 11; 12] and a matrix which contains for pairs of the previous matrix B = [ 1 2; 5 8; 8 9; 9 10 ; 10 11; 11 12 ] I want to complete A but without loosing the pairs in the second matrix. For instance A = [1; 2; 3; 4; 5; 6; 7; 8] B = [ 1 2; 3 4; 4 5; 5 6 ; 6 7; 7 8 ]. How is ti possible to implement this? Thank you in advance
댓글 수: 7
Adam
2018년 6월 6일
What do you mean by 'complete A'? Please give a full example of expected results. I don't understand how your second definition of A links in any way to the first or what you want the output to be.
DIMITRA GIANNOPOULOU
2018년 6월 6일
편집: DIMITRA GIANNOPOULOU
2018년 6월 6일
Jan
2018년 6월 6일
What are "floating elements"? I see 3 different definitions of the matrix A, two for matrix B and one for "A B", whatever this means. I cannot follow your explanations yet.
Please post the input data, us unique names for the variables, explain the procedure without freshly invented terms like "complete" or "floating", and post the wanted output.
DIMITRA GIANNOPOULOU
2018년 6월 6일
"After the exclusion I will have a matrix C = [1;2;5;7;8] which I want to sort it such that C = [1;2;3;4;5]."
This is not the definition of SORT in MATLAB or any other programming language, because you are changing the elements themselves, not just their order (which is how sorting is defined). If you want us to understand then you will have to explain the operation that converts [1;2;5;7;8] into [1;2;3;4;5]. Are those the sort indices ?
DIMITRA GIANNOPOULOU
2018년 6월 6일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!