필터 지우기
필터 지우기

How do I append a timestamp in a loop?

조회 수: 1 (최근 30일)
farzad
farzad 2020년 5월 6일
댓글: farzad 2020년 5월 7일
Hi All
trying the following code, I noticed that the output has not appended the t array for m times but only for two times. one the original and once appended. How should I
modify it in a way that the array t, is appended m times ?
resol is the time stamp resolution
for n=1:size(m)
if n==1
Ttot=t.';
else
Ttot= [Ttot,t.'+Ttot(end)+resol];
end
end
  댓글 수: 2
jessupj
jessupj 2020년 5월 6일
편집: jessupj 2020년 5월 6일
what is m?
size(m) is probably a 2x1 vector of length and width of m (assuming m is a 2d array).
try 'length(m)' for the loop, or e.g. size(m,1) to identify which dimension of m to iterate over.
farzad
farzad 2020년 5월 7일
thank you very much ! that was right !

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by