How to assign the value of the index to the index position?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello dear Matlab Community
I have a row vector with the size of 1x40000. The vector consists of zeros and ones.
How can i convert the value ones to the value of their corresponding indices?
Here is a small example
v = [0 0 0 1 1 1 0 0 0]; % This vector ones at positions 4,5, and 6, and I want that the ones get changed by the values 4,5, and 6.
Thank you in advance,
Paul
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!