how to modify all elements in a row vector
Afficher commentaires plus anciens
Hello I wanted to ask if I have a row vector and I want to medofy each element of the vector in such way that element 1 is equal to (element 1 *0), and element2= (element2*1) and element3= (element3*2) and so on. is possible to implement this is matlab? do I need a loop?
Réponse acceptée
Plus de réponses (1)
madhan ravi
le 13 Août 2020
vector(:) .*(0:numel(vector(:)) - 1)
1 commentaire
madhan ravi
le 13 Août 2020
Are you trying to finish your homework by making others do it? Start with MATLAB On-ramp.
Catégories
En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!