how to find the Reverse process of A(B).
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Tanveer ul haq
am 27 Mär. 2020
Bearbeitet: the cyclist
am 27 Mär. 2020
I have two arrays A and B. for instance,
A=[1 3 2 4 5 6 7 8 8 9 11];
B=[10 4 3 1 7 6 9 5 2 8 11];
in matlab
A(B)=[9 4 2 1 7 6 8 5 3 8 11];
My question is: How to calculate A, if B and A(B) are given.
Any help will be appericiated.
0 Kommentare
Akzeptierte Antwort
Adam Danz
am 27 Mär. 2020
Bearbeitet: Adam Danz
am 27 Mär. 2020
A=[1 3 2 4 5 6 7 8 8 9 11];
B=[10 4 3 1 7 6 9 5 2 8 11];
C = A(B);
A2(B) = C;
However, if B contains duplicate values, A2 will not equal A.
1 Kommentar
the cyclist
am 27 Mär. 2020
Bearbeitet: the cyclist
am 27 Mär. 2020
On that last point ...
To be clear, no algorithm would guaranteed to replicate A, if there are duplicate values in B, because there is insufficient information to do so. But you can find an A that is consistent with A(B) = C.
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!