Info
Questa domanda è chiusa. Riaprila per modificarla o per rispondere.
Creating a parameter which indicates adding values to only part of the elements in a Matrix?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti

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 Commenti
Risposte (1)
Roger Stafford
il 14 Apr 2017
p = 1:round(alpha*size(OldMatrix,1));
NewMatrix(p,:) = OldMatrix(p,:)+data;
0 Commenti
Questa domanda è chiusa.
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!