Info
This question is closed. Reopen it to edit or answer.
Creating a parameter which indicates adding values to only part of the elements in a Matrix?
1 view (last 30 days)
Show older comments

alpha represents the proportion of elements in OldMatrix can be from 0 to 1.
How can I create a create a parameter like alpha that indicates that I only only want to add an integer like data to only a proportion of the elements in matrix such as OldMatrix ?
0 Comments
Answers (1)
Roger Stafford
on 14 Apr 2017
p = 1:round(alpha*size(OldMatrix,1));
NewMatrix(p,:) = OldMatrix(p,:)+data;
0 Comments
This question is closed.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!