Created
October 2, 2012 14:53
-
-
Save indapa/3819778 to your computer and use it in GitHub Desktop.
set elements of vector to a value given a list of indices
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val=randn(1,10); % get 10 random values | |
indx=[10 9 8 7 6 5 4 3 2 1] % vector representing indices | |
value(indx)=val % set the indices of value to value | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment