How to collect non-integers from for loop in one matrix?
조회 수: 2 (최근 30일)
이전 댓글 표시
eg: for k=1:.5:10 y(k)=[k] end
this wont work i need output as y=1 1.5 2 2.5 and so on.
댓글 수: 0
채택된 답변
Azzi Abdelmalek
2015년 7월 1일
편집: Azzi Abdelmalek
2015년 7월 1일
ii=0;
for k=1:.5:10
ii=ii+1
y(ii)=k
end
or
k=1:.5:10
for ii=1:numel(k)
y(ii)=k(ii)
end
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 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!