It's a stupid question but these two line of code do the same thing wthere dt1 is a constant. Is it right?
prova= sum((out1.Y{i}(:,3:end)).^2)*dt1;
h=1;
for i=3:end;
y1=out.Y(:,i);
prova(h)=sum(y1.^2)*dt1;
h=h+1;
end;

댓글 수: 1

Jan
Jan 2014년 2월 22일
Replace for i=3:end by for i = 3:size(out.Y, 2) .

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

 채택된 답변

Walter Roberson
Walter Roberson 2014년 2월 22일

0 개 추천

Yes, they appear to be, at least to the limits of round-off error.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

태그

질문:

2014년 2월 22일

댓글:

Jan
2014년 2월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by