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!