Hi,
I'm going to define a loop which adds a certain value to each row of my 512 rows and 1 column data. The certain value is 0.3, so it must become like this:
0.3
0.6
0.9
0.12
0.15 and so on till the 512th row which is 512*0.3
Anyone knows the for command for this loop? Thanks

 채택된 답변

madhan ravi
madhan ravi 2018년 11월 27일

0 개 추천

no loops needed use cumsum instead:
cumsum(0.3*ones(1,512))

추가 답변 (1개)

Alireza Shirkhani
Alireza Shirkhani 2018년 11월 27일

0 개 추천

Thank you

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

질문:

2018년 11월 27일

댓글:

2018년 11월 27일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by