last values in for cycle

조회 수: 1 (최근 30일)
Jakub
Jakub 2013년 4월 18일
Lets say I have vector of values. length of that vector is 350. and i want for cycle that do something with first hundred of values, then with second hundred, third hundred and in the end with the last fifty. i dont know how to deal with the last 50 values. and i have to work withh all values a work with them by hundreds. Thank you for help!!

답변 (1개)

Image Analyst
Image Analyst 2013년 4월 18일
Do the for loops like this
for k = 1 : 100
% Do stuff with vector(k)
end
for k = 101 : 200
% Do stuff with vector(k)
end
for k = 201 : 300
% Do stuff with vector(k)
end
for k = 301 : 350
% Do stuff with vector(k)
end
  댓글 수: 1
Jakub
Jakub 2013년 4월 18일
But what if the vector length is 20050?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Data Distribution Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by