how to modify all elements in a row vector
이전 댓글 표시
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?
채택된 답변
추가 답변 (1개)
madhan ravi
2020년 8월 13일
vector(:) .*(0:numel(vector(:)) - 1)
댓글 수: 1
madhan ravi
2020년 8월 13일
Are you trying to finish your homework by making others do it? Start with MATLAB On-ramp.
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!